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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

"Reverse Native Query" to convert SQL to M?

Hi all,

 

I have a team of Power BI developers who all come from a SQL background and are struggling to understand the possibilities of M for making complex queries from SQL databases. Their standard practice is to dump enormous SQL queries in at the very beginning of their table query and then do a few M transformations, which is putting us in a worst of all worlds situation where our queries can't fold. 

 

I know that when you write M to query a SQL source, you can then use Native Query to see the SQL that is actually being sent to the database. What I would love to find, but have not been able to, is a tool that would do the opposite - that could take a given SQL statement and convert it into M, so that we could work towards doing all of our transformations in M and then fold that query back. Has anyone heard of such a thing?

3 REPLIES 3
foodd
Super User
Super User

Not yet, as far as I know.

 

This sounds much like a cross between a cultural and communication issue.

 

What is true: 

  • Power BI craves a Star Schema, and does best when following Roche’s Maxim of Data Transformation .
  • "The lesson here is that if you’re going to write your own SQL query in the Query Editor, you should make sure it does all of the expensive filters and transformations you need because anything else you do in the query will happen outside the database in Power BI."  Thank you Chris Webb

 

 

Anonymous
Not applicable

Yes, the ideal would be that these developers would be able to create views on the database that contain the results of their statements, which we could then just bring in as SELECT *. Unfortunately for reasons beyond my control that's not the case, so I'm scrounging for alternate solutions that could at least fold up to the database and enable incremental refresh instead of the worst-case scenario we're in now.

Add charge-back system for rework for every time performance becomes an issue 🙂

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors