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
roysampad91
Frequent Visitor

Trigger an M Query on a button click on Power BI

I am trying to "POST" to a REST API and have achieved it via M Query. Could anyone please help on how to trigger the M Query on a button click on Power BI?

3 REPLIES 3
roysampad91
Frequent Visitor

roysampad91_0-1716971576221.png

this is my M query and it's doing what is expected however want to parameterise the body and trigger it on a button click.  Need help to understand how to achieve the same?

Hi @roysampad91 

 

Currently the native button in a Power BI report cannot trigger a Power Query M query. Because PowerQuery is used for data ETL, and the buttons in the report are added when making the report. Reporting happens after the data ETL, so there is no way to use a button to trigger an action that should happen before.

 

May I know why you want to trigger it on a button click? Do you hope that report users can use the button to trigger the query? If so, this is not supported for the reason above.

 

You may explore Power Automate to create a flow to trigger a POST request but you have to store the data received to somewhere else out of Power BI. The data received cannot be loaded into the same PBI report where the trigger-flow button is.

 

Hope these explanations help. 

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Sergii24
Super User
Super User

Hi @roysampad91, could you tell more on how you've managed to make "post" request with M language of Power Query? As of my knowledge PowerQuery is used for data transofrmation only, so I'm curious to know how you managed to create a post request.

However, to launch an action from directly from PowerBI report you can use "Power Automate visual" and create Power Automate flow that will perform necessary actions (including post htttps reqeust). You can learn more about it in this video and Microsoft documentation - Create a Power Automate visual for Power BI - Power BI | Microsoft Learn

Good luck with your project! 

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!

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.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.