Forum Discussion

gonrodrigues's avatar
gonrodrigues
Helper III
10 years ago
Solved

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!

  • gonrodrigues Create two measure with below code.

     

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

      

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

5 Replies

  • ankitpatira's avatar
    ankitpatira
    Community Champion

    gonrodrigues Create two measure with below code.

     

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

      

    CountValuesC =
    CALCULATE ( COUNTROWS (YourTable); YourTable[YourColumn] = "c" )
    • gonrodrigues's avatar
      gonrodrigues
      Helper III

      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

      • sdjensen's avatar
        sdjensen
        Solution Sage

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

    • Calumc12's avatar
      Calumc12
      Helper I

      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