Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Currrently the M Language in a Power Query that extracts data from a workbook looks like:
let
Source = Excel.Workbook(File.Contents("P:\So Fiscal Administration\Cost Centers\PeopleSoft_Accounts_SAMIS_Object_Codes.xls"), null, true),
Acct_Codes1 = Source{[Name="Acct_Codes"]}[Data]
in
Acct_Codes1
How would I change the above if I wanted to use an SQL statement like the following to extract the data:
Select Acct, Acct_Descr from Acct_Codes
Note: I know I could use the former code and then remove other columns, but I'm curious if I can use the latter code; i.e., can I use an SQL select statement in the top code?
Thanks in advance..
@ND_Pard there is a way. If you have premium workspace, bring your data to datamart and the world of SQL is open to you.
you cant use sql statement on a excel data extraction.
Proud to be a Super User!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 5 | |
| 4 | |
| 3 |