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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
PBIFanHook7
Helper III
Helper III

Power BI Desktop sql native queries vs Power Query Editor native queries performance differences

I have read where the performance difference between using native SQL queries within Power BI Desktop's "Get Data" options verses using Power Query Editor (Get Data) and applying transformations in PQE, depends on several factors, primarily related to query folding. 

 

However, I have a simple Oracle SQL Native Query (like below) which I bring into Power BI Desktop's ("Get Data" options) and I DO NOT need to apply any PQE transformations to it, 

 

(1) Would this approach have a negative impact on performance?

 

(2) Would the below SQL Native Query (brought into Power BI Desktop) still execute on the source database and would the results be returned to Power BI Desktop (and not PQE)?

 

(3) If there is not a need to apply transformations in PQE, is it be okay to use SQL Native Queries within Power BI Desktop?

 

Simple SQL Native Query:

 

SELECT TT.*,
CASE WHEN TT."Color" = 'Red' THEN 1
WHEN TT."Color" = 'Blue' THEN 2
WHEN TT."Color" = 'White' THEN 3
WHEN TT."Color" = 'Green' THEN 4
ELSE 99
END AS "Color Sort Order"
FROM TestTable TT


Note the above SQL Native Query returns only about 10 columns (so I used the TT.*) and it returns about 5,000 rows. I am using DirectQuery Mode.

 

Thanks in advance for all help, suggestions, recommendations, etc.

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @PBIFanHook7 

It is generally best practice to push transformations as close to the source as possible. If you cannot create a proper view in Oracle, then using a native SQL query in Power BI is fine. Performance considerations will still apply in DirectQuery mode, since it is always slower compared to Import mode. The SQL query you wrote will execute on the Oracle database itself, and the results will be returned to Power BI.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

4 REPLIES 4
v-tejrama
Community Support
Community Support

Hi  @PBIFanHook7 ,

 

Thank you @Ritaf1983  for the response provided!

Has your issue been resolved? If the response provided by the community member addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.

Thank you for your understanding!

 

Yes, my questions were answered by @Ritaf1983. 

Ritaf1983
Super User
Super User

Hi @PBIFanHook7 

It is generally best practice to push transformations as close to the source as possible. If you cannot create a proper view in Oracle, then using a native SQL query in Power BI is fine. Performance considerations will still apply in DirectQuery mode, since it is always slower compared to Import mode. The SQL query you wrote will execute on the Oracle database itself, and the results will be returned to Power BI.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thanks for the excellent response. You provided what I needed. 

Helpful resources

Announcements
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.