Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a pbix file that runs some Python at the end of a Power Query data refresh. I don't want the Python to run if I'm doing dev work on the file. Is there any way to prevent this from happening? Is there any way to tell programmatically or otherwise if a query is running on the desktop or on the service?
Thanks!
Solved! Go to Solution.
Hello @Griffin_BI ,
yes, you can set a parameter in Power Query, lets say "Platform".
This parameter you can set to the value "Desktop" and then not run the python script if "Platform" = "Desktop".
On the Power BI Service you can change the value of the parameter to "Service" and then the python script should run.
Check the following tutorial, here they just change the data source for Desktop and Service, but you will get how it works:
Change the Source of Power BI Datasets Dynamically Using Power Query Parameters - RADACAD
Hello @Griffin_BI ,
yes, you can set a parameter in Power Query, lets say "Platform".
This parameter you can set to the value "Desktop" and then not run the python script if "Platform" = "Desktop".
On the Power BI Service you can change the value of the parameter to "Service" and then the python script should run.
Check the following tutorial, here they just change the data source for Desktop and Service, but you will get how it works:
Change the Source of Power BI Datasets Dynamically Using Power Query Parameters - RADACAD
@selimovd thanks for the reply. That is a decent solution and workable. I could put the parameter in the Python string in the formula box in Power Query.
Ideally the solution would be able to tell without any manual input whether the .pbix is refreshing on the desktop or service, but if no one else replies I will mark this as a solution.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.