Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
SoftexTI
New Member

Calling routines and actions

We have some questions about the possibility of performing some actions within Power BI:
1. It is possible to create a button that calls a routine/action, such as:
   - Fetch data from one or more data sources and import into a Power BI dataset
   - Run a python script
2. Is it possible to pass parameters to the action triggered by the button?
3. Can we create a form where we would have a selection component and a button whose action receives as a parameter the value selected in the selection field?

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @SoftexTI ,

 



1. It is possible to create a button that calls a routine/action, such as:
   - Fetch data from one or more data sources and import into a Power BI dataset


If you want to get the latest data from your data sources, you can create a button to run a flow (Power Automate).

 

 


1. It is possible to create a button that calls a routine/action, such as:
   - Run a python script

 

To my knowledge, it doesn't supported to use a button to run a python script. You can create a Python visual. Or if you want to export something via Python, how about using Python in Power Query Editor? And then it will auto export what you want when dataset is refreshed. You can use above refresh button to manually run this python script.

 

 



2. Is it possible to pass parameters to the action triggered by the button?


If you are connecting to M based data sources via Direct Query, you can try to create Dynamic M query parameters in Power BI Desktop. With Dynamic M Query Parameters, model authors can let report viewers to use filters or slicers to set the value(s) for an M Query Parameter. 

 

In other cases, it is not currently supported.

 



3. Can we create a form where we would have a selection component and a button whose action receives as a parameter the value selected in the selection field?

Please check the above document about Dynamic M Query Parameters.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Icey
Community Support
Community Support

Hi @SoftexTI ,

 



1. It is possible to create a button that calls a routine/action, such as:
   - Fetch data from one or more data sources and import into a Power BI dataset


If you want to get the latest data from your data sources, you can create a button to run a flow (Power Automate).

 

 


1. It is possible to create a button that calls a routine/action, such as:
   - Run a python script

 

To my knowledge, it doesn't supported to use a button to run a python script. You can create a Python visual. Or if you want to export something via Python, how about using Python in Power Query Editor? And then it will auto export what you want when dataset is refreshed. You can use above refresh button to manually run this python script.

 

 



2. Is it possible to pass parameters to the action triggered by the button?


If you are connecting to M based data sources via Direct Query, you can try to create Dynamic M query parameters in Power BI Desktop. With Dynamic M Query Parameters, model authors can let report viewers to use filters or slicers to set the value(s) for an M Query Parameter. 

 

In other cases, it is not currently supported.

 



3. Can we create a form where we would have a selection component and a button whose action receives as a parameter the value selected in the selection field?

Please check the above document about Dynamic M Query Parameters.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@SoftexTI , I think power Automate visual should help. But not sure it can fit in all needed.

 

refer if needed

https://www.youtube.com/watch?v=-8NlEeIIRiQ

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.