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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have a query in Power BI that returns the top 17 rows from a table.
I use COUNTROWS(table) to return the number of rows in the table and the result is 289! How can this be?? No filter anywhere on the report.
Here is the DAX formula I am using. This happens anywhere I try to apply the COUNTROWS function in my report.
Hi, @MikeyLikesPwrBI
I assume you stucture is like this:
-You have table named Query1.
-Query1 is a table with 1 column and 17 rows.
-You add calculated column called Column with this code
Column = COUNTROWS(Query1)
For each row of Query1, the value of Column will be 17.
If you now drag Column into any kind of visual, it will sum up all rows of Column, giving you 17*17.
This can solved by creating a measure like this:
numberOfRows = countrows(Query1)
instead of doing it like a calculated column.
If I am wrong in my assumptions, it would be helpfull if you recreate your issue in a sample report and share that report here
Cheers,
Sturla