Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
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!
Solved! Go to Solution.
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])}
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
Problem is solved!
Thank you!
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])}
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 6 | |
| 6 |