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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Get Dataflow Query from the PowerBI REST API?

Hi,

 

I'm aware I can use the "Dataflows - Get Dataflow Data Sources" REST API to get a list of the Connection Sources for a given Dataflow however, I can't seem to find out how to return the specific query?

 

For instance, a Dataflow I have has a connection to our Sql server. From that API, I can see successfully in the API return:

 

datasourceTypeconnectionDetailsdatasourceIdgatewayId
Sql@{*sql server name & database*} The datasource IdThe Gateway Id


However, I know that the dataflow is using a custom Sql statement with case statements, where clauses etc. I'd like to use the API to extract those queries across multiple dataflows to programatically perform governance checks but I can't find another API end point that provides that....

 

Does that functionality exist in the API or CMDlets anywhere or does anyone have any other idea how to govern how dataflows are extracting data when you have 50+ of them?

 

Thanks

1 REPLY 1
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Sorry I am not familiar with it, please refer to the following link.

https://community.powerbi.com/t5/Report-Server/How-to-get-M-query-from-dataflows-Power-BI-Server-Analysis/td-p/2241080

https://docs.microsoft.com/en-us/rest/api/power-bi/dataflows/get-dataflow


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.