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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Solution Authors