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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
pthapa
Post Patron
Post Patron

How to get correct count of rows in PBI visual?

Hello all,

I have a table visual  in PBI and wanted to see how many records are there on that visual.

The measure that I created Row Count = COUNTROWS('Table_Name') will give me total number of rows in the dataset but not in the table visual I have.

See in below example, I have only two rows of records, but row count will say 4, that is not correct in my case.

How can I get this correct number of rows?

pthapa_0-1726683295777.png

Thanks,

pthapa

1 ACCEPTED SOLUTION
v-yajiewan-msft
Community Support
Community Support

Hi @pthapa, jdbuchanan71, thank you for your prompt reply!

 

Try the following measure:

Row Count Visual = COUNTROWS(SUMMARIZE(ALLSELECTED('Table'), 'Table'[CustomerName], 'Table'[CustomerID]))

Result:

vyajiewanmsft_0-1726823157407.png

Best regards,

Joyce

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

View solution in original post

7 REPLIES 7
v-yajiewan-msft
Community Support
Community Support

Hi @pthapa, jdbuchanan71, thank you for your prompt reply!

 

Try the following measure:

Row Count Visual = COUNTROWS(SUMMARIZE(ALLSELECTED('Table'), 'Table'[CustomerName], 'Table'[CustomerID]))

Result:

vyajiewanmsft_0-1726823157407.png

Best regards,

Joyce

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

Hello @v-yajiewan-msft ,
Appreciate your response, yes the trick does work finally. I had to put all the columns that are in the visual to summarize, then it worked.

Thanks again.

pthapa

pthapa
Post Patron
Post Patron

Not sure why, the total doesn't work for all. Anyone has idea how to fix the total?
It seems working for some but not for all if I use the filter for Customer No to check.

pthapa_0-1726686042372.png

Thanks,

pthapa

 

jdbuchanan71
Super User
Super User

@pthapa 

Give this a try.

Row Count = DISTINCTCOUNT ( 'Budget Template'[Customer No_] )

@jdbuchanan71 ,
Thanks for quick response however the distinct count will not give correct total at the bottom, why?
See example below.

pthapa_0-1726684316951.png

 

Because the count of unique customer no_ is 1 (100004), it is not organized the way I thought.  Take a look at Visual level calculations, you might need to go down that route since you are only wanting to cout the rows shown in the table.
https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-visual-calculations-overview

 

pthapa
Post Patron
Post Patron

Total Still isn't working, why?

 

Thanks,

pthapa

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!

December 2024

A Year in Review - December 2024

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