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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

 

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

 

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.