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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
PatDools
Frequent Visitor

Show table names/total row counts in power bi report

Hello - I'm a Power BI newbie.  I've noticed some interesting trends in the actual total row count of a series of tables I've brought in via Power Query.  I'd like to create a simple table report that shows as follows:

 

Table NameTotal Row Count
Table A2,100
Table B5,400
Table C7,500

 

Is there a formula to get the Table Names and the Row Counts  for that table in a Report?

 

2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @PatDools 
To generate the desired table please follow this steps :

1. Create measures that count tables rows :

Table A_rows = COUNTROWS('Table')
Table B_rows = COUNTROWS('Table (2)')
Table c_rows = COUNTROWS('Table (3)')
2. Create a table with 1 column of table names
3. Create a dynamic measure to switch between measures, based on the column that you created.
Table_Dynamic_Measure = if(SELECTEDVALUE('Table for show count rows'[Table])="Table A", [Table A_rows],
if(SELECTEDVALUE('Table for show count rows'[Table])="Table B", [Table B_rows],[Table c_rows])
)
Unfortunately, I am out of the limit of images that I can add to the discussion so I recorded the screens into a small video, You can download it from: Here 
and pbix from: Here 
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Thank you so much for this, Rita - your instructions/video were clear and led me to the solution I needed.  Thanks again!

View solution in original post

2 REPLIES 2
Ritaf1983
Super User
Super User

Hi @PatDools 
To generate the desired table please follow this steps :

1. Create measures that count tables rows :

Table A_rows = COUNTROWS('Table')
Table B_rows = COUNTROWS('Table (2)')
Table c_rows = COUNTROWS('Table (3)')
2. Create a table with 1 column of table names
3. Create a dynamic measure to switch between measures, based on the column that you created.
Table_Dynamic_Measure = if(SELECTEDVALUE('Table for show count rows'[Table])="Table A", [Table A_rows],
if(SELECTEDVALUE('Table for show count rows'[Table])="Table B", [Table B_rows],[Table c_rows])
)
Unfortunately, I am out of the limit of images that I can add to the discussion so I recorded the screens into a small video, You can download it from: Here 
and pbix from: Here 
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thank you so much for this, Rita - your instructions/video were clear and led me to the solution I needed.  Thanks again!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.