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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 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.

Sept NL Carousel

Fabric Community Update - September 2024

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