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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Table visual display total number of rows

Hello

I have the following data in a table visualization in Power BI and i simply want to count the number of names and show the total at the bottom of the table in a row with the text:  Total = 11. Under Format, i have the Total option enabled but it does not show anything new in the visual. Any help is much appreciated!

MakeItReal_0-1649992463665.png

MakeItReal_1-1649992549693.png

 

 

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

Here is a "hack". Create a measure along the lines of:

With Totals = 
IF(ISINSCOPE('Table'[Name]), MAX('Table'[Name]), "Total " & COUNTROWS('Table'))

Create the table visual with the name field and the measure and turn off the word wrap options in the formatting pane:

wrap.jpg

 

Now hide the name column by dragging the column's border left:

total text.gif

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

6 REPLIES 6
PaulDBrown
Community Champion
Community Champion

Here is a "hack". Create a measure along the lines of:

With Totals = 
IF(ISINSCOPE('Table'[Name]), MAX('Table'[Name]), "Total " & COUNTROWS('Table'))

Create the table visual with the name field and the measure and turn off the word wrap options in the formatting pane:

wrap.jpg

 

Now hide the name column by dragging the column's border left:

total text.gif

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thank you PaulDBrown, I was looking for a similar solution and your post helped me.

parry2k
Super User
Super User

@Anonymous unfortunately that is not possible with the measure without using another column on the rows or values. The only way I can think of creating a new table that has all the student names and a new row with a total number of students and then you use it in your visual and that will work.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k

Could you please explain what's the difference between your code and this code which gives the same results: 

 

Name count = COUNTROWS('Student name list')

 

parry2k
Super User
Super User

@Anonymous you need to create a measure to make it work. I guess at this point you have put a name column on the rows and it is not getting aggregated. To make it work, add a following measure and use it on the values:

 

New Measure = 
IF ( HASONEFILTER ( YourTable[Student Name] ), 
     MAX ( YourTable[Student Name] ),
     Format ( COUNTROWS ( YourTable ), "General Number" )
)

 

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi @parry2k Thanks for your reply! I did as you suggested but it does not look right since i only want one column of names and the total number of names underneath. Is that possible?

If i remove "Student Name" field from the values, i get only the total and no list of names.

MakeItReal_0-1650003717821.png

MakeItReal_1-1650003765062.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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