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
gonrodrigues
Helper III
Helper III

Measure to count text in column

Hello

 

How can i create a measure to count two different values in a column at the same time? 

 

P.E. a column with 'a', 'b', 'c'. I want to count 'a' and 'c'.

 

Thanks!

1 ACCEPTED SOLUTION
ankitpatira
Community Champion
Community Champion

@gonrodrigues Create two measure with below code.

 

CountValuesA =
CALCULATE ( COUNTROWS (YourTable); YourTable[YourColumn] = "a" )

  

CountValuesC =
CALCULATE ( COUNTROWS (YourTable); YourTable[YourColumn] = "c" )

View solution in original post

5 REPLIES 5
ankitpatira
Community Champion
Community Champion

@gonrodrigues Create two measure with below code.

 

CountValuesA =
CALCULATE ( COUNTROWS (YourTable); YourTable[YourColumn] = "a" )

  

CountValuesC =
CALCULATE ( COUNTROWS (YourTable); YourTable[YourColumn] = "c" )

@ankitpatira 

 

I seem to be having a syntax issue with the second part i.e.

YourTable[YourColumn] = "a" )

 Do i need a formula here to read the data in my data

If I'm creating a measure that is a percentage, how can i put '%' symbol in the end to present that in a card?

 

Thanks @ankitpatira

On the "Modeling" tab you can format the measure as a percentage.

/sdjensen

Thanks a lot! @sdjensen

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.