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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
croberts21
Continued Contributor
Continued Contributor

Use SQL Statement as a data source because it's 10x faster.

Power BI desktop can be very slow over an ODBC connection with Postgresql. It can get an out of memory error or use a lot of resources. It can take 10-20 minutes or more to get data from one table with millions of records. Here's a fast way to limit the records and skip the Transform step which can be very time-consuming. Use an SQL statement as the data source.

 

  1. Go to Home tab bar.
  2. Choose Get Data dropdown and click More.
  3. Search for ODBC and choose ODBC. Click Connect button.
  4. A window will pop up. Click arrow on Advanced Options.
  5. Enter your SQL statement in the "SQL Statement" box.

 

To edit the SQL statement:

  1. On the far right of PBI, under the Fields pane, right click the table, choose Edit Query.
  2. A Power Query Editor window will pop up.
  3. On the far right, under Applied Steps, double click Source.
  4. Another window will pop up with your SQL statement which you can edit.
  5. After editing the SQL click the OK button.
  6. Now you are back to the Power Query editor. In the upper left of the window click Close & Apply.

Thanks for all your help people! I hope this helps someone. 

 

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @croberts21 

 

Thanks for sharing!

 

Best Regards,
Community Support Team _ Jing

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors
Top Kudoed Authors