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
AndrewRichards
New Member

Count number of rows in a text column

Morning all

 

Firstly, my apologies - I'm sure I'm an idiot. What I want is SO simple that I can't believe I can't find it. I've also just spent 45 mins searching for an existing post to answer it, but can't find what I want that way either. So, apologies.

 

I have a table, with two columns, both containing text. I don't want to add any further columns. All I want is a count of the number of rows at the bottom. Something like this (screenshot taken from Excel):

 

Power BI question.png

 

I've tried specifying "Count" for the column in the visualisations panel, but that removes the name from each row and instead counts each row, so I've reverted back to "Don't summarize" so that I get the names back. 

 

I've tried creating a new Measure, simply containing COUNTROWS(CasesTable), and when I add this, I get my total (yay!), but at the bottom of a new column which contains a 1 for each row (boo!). 

 

I know this must be really easy, but I can't find it. Can someone point me in the right direction?

 

Thank you!

 

 

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

Hi @AndrewRichards ,

 

We can create a measure and use it in the table visual, then close the word warp of column header and values to hide the origin survery column

 

Surveyor Measure = IF(ISINSCOPE('Table'[Surveyor]),SELECTEDVALUE('Table'[Surveyor]),COUNTROWS('Table')&"")

 

 

3.jpg4.jpg5.jpg6.jpg7.jpg

 

If the case ref only has one surveyor, we can just use the following measure to meet your requirement:

 

8.jpg

 


Best regards,

 

Community Support Team _ Dong Li
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

2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hi @AndrewRichards ,

 

How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @AndrewRichards ,

 

We can create a measure and use it in the table visual, then close the word warp of column header and values to hide the origin survery column

 

Surveyor Measure = IF(ISINSCOPE('Table'[Surveyor]),SELECTEDVALUE('Table'[Surveyor]),COUNTROWS('Table')&"")

 

 

3.jpg4.jpg5.jpg6.jpg7.jpg

 

If the case ref only has one surveyor, we can just use the following measure to meet your requirement:

 

8.jpg

 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.