Showing results for 
Search instead for 
Did you mean: 
Helper II
Helper II

How to get number of rows from a table visual



I trying to figure out how I can create a measure that can show the number of rows in a table visual. 

I have made a simple measure like COUNTROWS('Tablename'), and that works ok as long as I just use the Page and Report filters, but when it comes to the Visual filters, it doesn't change the numbers. I assume it's because the visual filter is kind of done "within" the visual and therefore doesn't affect my measure. The question if then if it's possible to create a measure that works "inside" the visual so I can see the acual number of records in the visual - no matter where the filtering is done?


Sorry if this is a double post, but I doesn't find the one I posted for some hours ago.




Community Support
Community Support

Hi @steen_p ,


I suspect that your data set is too large to cause calculation delay. When filtering at the visual level, maybe the calculation is frozen. Generally speaking, applying the same filter at three levels will not affect the results.


Best Regards,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Champion
Community Champion

Hi @steen_p 

In my understanding you want to count rows for a visual when a filter is selected! if so then you need to embed the Measure SLECTEDVALUE to your COUNTROWS.


It's not very clear your description maybe if you can share a Sample PBIX then we can help you better.


Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook


I'm not sure if SELECTEDVALUE will solve the problem, because it's not a specific selected value as such I'd like to count, but how many rows I have in a table visual.


And my existing measure that just does a COUNTROWS seems to do it ok as long as I use the filters for the Report and the Page, but it doesn't reflect the filtering im doing on the visual. 

So I'm looking for a way to do this? The reason is that my users are exporting data to Excel from  this table and since Power BI are limited to export 150.000 rows I need to have a measure showing how many rows I have in the table with the different filters set. 

Maybe it doesn't have to be a measure or a count, but I just can't figure out any other way yo get this number.


In another reply., I also go the suggetion to use SUMMARIZECOLUMNS and then COUNTROWS but for some reason I can't get that measure to work at all.

Rgiht now my measure is - 

No of Rows in selection =
SUMMARIZECOLUMNS('TableName'[Column1], 'TableName'[Column2]))


This one works when I test it in DAX Studio, but when I add it as a measure in my Power BI file, if gives me an error about "Calculation error im measure 'All Meassures'[No of Rows in selection]: SummarizeColumns and AddMissingItems() may not be used in this context."

I simply can't figure out what it wrong with it in Power BI, when it works in DAX Studio.


I'm still not sure if it will solve my problem though, because I could image that this wouldn't "see" the filtering on the visual either.




Helpful resources

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors