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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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