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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
smpa01
Super User
Super User

Running SQL Queries on an excel table fails in PBI but works in excel

Hello Experts,

 

I am currently querying a large excel table in PQWRY and to avoid transformations using M, I thought of running SQL Statement on an excel table.

 

It is doable in excel. For example, I can query an excel data source in another excel by

Get Data-> From Other Queries-> From Microsoft Query->Excel Files.

excel query.PNG

 

I can utilize the Command text box to execute the SQL statement. It is

 

Now when I tried the same thing in Power BI, it did not work. I am not sure what am I doing wrong?

 

pqwry.PNG

xsxa.PNG

My raw data (table) is following

 

Count

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

 

I want to execute a SQL statement as

 

SELECT *
FROM table
WHERE [Count]<=10.
ORDER BY [Count] DESC

 

 

Any help is greatly apprecaited. I want to avoid slow and performance deterring M statements.

 

Thank you in advance.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
2 REPLIES 2
smpa01
Super User
Super User

I did another test where I queired a SQL server view and it worked fine both in excel and power bi

 

Excel

x1.PNG

 

This is what I am getting in PBI and these are my current ODBC drivers. I am not sure if the eroor is happeing due to the fact I don't have an odbc driver for excel. But I am also not sure if that is the case why it worked in excel in first place.

 

x2.PNG

 

Thanks

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
Anonymous
Not applicable

@smpa01 

You might want to create a support ticket for further analysis of this issue.

 

Regards
Paul

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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