Skip to main content

Power BI

New

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

Vote (28) 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 (4)
Taras's profile image Profile Picture

2c3278d6 bf96-47b4-b63b-d9c34fb82e6e 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

06d173ba fcd9-4ba1-a226-cd1f75cd3963 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

d031d259 593d-46e4-94cb-19b25c1dfc6e 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

88a96cd1 463c-43c6-8e0c-4bb9f7e271b6 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.