Skip to main content
Microsoft Idea

Power BI

Needs Votes

Support refresh from the web when running code/script (Power Query, SQL, R...) from a text file

Vote (36) Share
Taras's profile image

Taras on 17 Feb 2017 06:24:47

When you deploy multiple dashboards that use the same script/code (whether it data transformation in Power Query (M), a SQL statement or an R code), it is efficient to put one code in a text file, and query against the file, rather then copy/pasting the code every time you make a change.

Here is an example of a workaround: https://blog.crossjoin.co.uk/2014/02/04/loading-power-query-m-code-from-text-files/

The problem is that now you can't schedule a refresh from the web: Power BI throws an error
"You can't schedule refresh for this dataset because one or more sources currently don't support refresh."

Can you make such approach acceptable and support scheduled refresh?

Comments (5)
Taras's profile image Profile Picture

Pascal Bellerose on 02 Feb 2021 16:14:16

RE: Support refresh from the web when running code/script (Power Query, SQL, R...) from a text file

This could be really usefull to allow for some collaboration between developers and end-users. Currently, an end-user can't work on the same PBIX file as a developer does event though they are not making conflictual changes.
The developer could be implementing complex transformations while the end-user just wants to format some fields, adjust relationships, add new sources.
Otherwise, the end-users might end up doing stuff themselves in Power Query without any IT involvement which, if not mentored properly, can lead to erroneous measures and data.
Or worse, IT will completely give up power Query to end-users and manage all measures in other data warehouse, cubes or data lakes.

Taras's profile image Profile Picture

Sébastien De Bosscher on 06 Jul 2020 00:12:42

RE: Support refresh from the web when running code/script (Power Query, SQL, R...) from a text file

Why not vote for a native solutions from power BI?

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/40272415-reuse-custom-power-query-functions

Taras's profile image Profile Picture

Cristian Avendaño on 06 Jul 2020 00:09:17

RE: Support refresh from the web when running code/script (Power Query, SQL, R...) from a text file

This is something we need.. It's a paint to copy the code and mantain the same version of the code.

Taras's profile image Profile Picture

Amadeusz Wieczorek on 05 Jul 2020 22:41:02

RE: Support refresh from the web when running code/script (Power Query, SQL, R...) from a text file

My team is sharing queries on git (for sharing and peer reviews) and we would also really like to load them from disk. Currently on each change we need to manually go to Advanced Editor and paste the updated query

Taras's profile image Profile Picture

Taras on 05 Jul 2020 22:41:02

RE: Support refresh from the web when running code/script (Power Query, SQL, R...) from a text file

I actually store my codes in OneDrive for Business, but I point Power BI to the web link, not the folder on the hard drive. But that doesn't matter: the main idea is to let Power BI consume the code from the text file, whether hosted on disk, on the cloud or anywhere else.