Quantcast
Channel: Service topics
Viewing all articles
Browse latest Browse all 62095

Dataflows - any reason not to use a custom SQL script? It's a slight workaround, and I wonder why

$
0
0

In PBI Desktop, when connecting to a SQL server sourcee ,you have an option to write your own query:

 

Option in Desktop.PNG

 

In Dataflows though, this option is missing

 

 

No Option in Dataflows.PNG

 I can recreate it, by either writing the M code by hand, or - starting the connection in Desktop, then copying the M Code generated there,  and using that code in the Dataflow. 

In doing that, in a simple example, the code would go from

 

--M Code that Dataflow generates let Source = Sql.Database("ServerName", "DbName"), Navigation = Source{[Schema = "DW", Item = "TableName"]}[Data] in Navigation



And instead the code would be: 

--M Code using custom SQL script, either handwritten or generated from PBI Desktop let Source = Sql.Database("ServerName", "DbName", [Query="SELECT *#(lf) FROM [DW].[TableName]"]) in Source



Is there any downside to this? 
Why isn't custom-SQL script a direct option in Dataflows, like it is in Desktop? 


Viewing all articles
Browse latest Browse all 62095

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>