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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Query (1, 1) The expression specified in the query is not a valid table expression

I have a mesuare created and it is working just fine in my visuals.

However, when I try to run the same DAX expression in the DAX Query view, I'm getting the follow error message:

Query (1, 1) The expression specified in the query is not a valid table expression.

 

I'm using a GROUP BY() subquery that I need to countrows, so the returning value is just a single value.

When I remove the COUNTROWS() of the expression, I get a table from the 'GROUP BY()' normally without any error.

 

Is that any limitation in the DAX Query viwer? 

Thank you!

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

In Query view, you can only really return a table (hence why the COUNTROWS is throwing an error)
A quick hack to get to to show is to surround your expression with curly braces to force it into a table (i.e {COUNTROWS([your calculation here])}

View solution in original post

3 REPLIES 3
v-nuoc-msft
Community Support
Community Support

Hi @Anonymous 

 

@vicky_ Thank you very much for your prompt reply.

 

Can you tell me if your problem is solved? If yes, please accept it as solution.

 

Regards,

Nono Chen

 

 

Anonymous
Not applicable

Problem is solved!

Thank you!

vicky_
Super User
Super User

In Query view, you can only really return a table (hence why the COUNTROWS is throwing an error)
A quick hack to get to to show is to surround your expression with curly braces to force it into a table (i.e {COUNTROWS([your calculation here])}

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.