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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
masplin
Impactful Individual
Impactful Individual

SQL vs Power SQL joining of tables

I have  inherited a Power BI model built by a guy who came form an SQL background whereas I come from an Excel background and very rudimenatary knowledge of SQL. 

I need to expand on some of the queries to bring in a dditionla data form related tables that was not in the original specification.  The SQL is already looknig liek spaghetti as the database has seperate data tables for each client so to create a company level query each subquery is repeated multiple times for each client database.

 

The question this.  I can see clearly how to write a similar SQL multi database query to extract and join all the data for each client from the additional table. I can then eassily merge this new table with the exisitng table to add the extra columns I need.  to do this in SQL is going to be alot more painful as i don't know how to edit the query. However is their a substantial speed advantage to joining all the tables together in a single SQL query rather thna using Power Query to merge the reuslts of 2 SQL queries?  If there is I better learn some SQL :). we are tlaking about 500,000 rows of data. 

 

Thanks for any advice

Mike

 

2 REPLIES 2
houston39
Helper I
Helper I

Hi Mike,

Do you have access to SSMS?  Also, retrieving the SQL embedded within power BI is not very difficult, one you step through it.

 

Check this out:

 

https://community.powerbi.com/t5/Desktop/Edit-Existing-SQL/td-p/48607

 

Then, see if you can run the query within SSMS - if you can I will assist you further.

 

G

Anonymous
Not applicable

@masplin,

I always recommend people to write SQL if they can to get the data, since all the heavylifting work is done at the server level, hence faster retrieving time. In some cases, depending on the types of the SQL databases, drivers, and the complexity of the transformations in Query Editor, some of the transformations might not be converted into SQL statements to run at the database server but rather be performed using your local machine's memory and processor. You can check if your transformation is converted to SQL by right click on a particular step. If 'View Native Query' is greyed out, it means the transformation is done locally, otherwise you should see the converted SQL statement. Hope this helps!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.