Forum Discussion

hkrash0920's avatar
hkrash0920
Helper I
9 years ago
Solved

Countrows Function

Hi...I am not sure I what I about to say correctly so please forgive me. I am trying to count rows in a table and have the filters that have applied to the table outside applied.

 

When I use the Count function where all the fields are listed, I get the correct number.

 

 

However, I want to change the name of the column from "count of client" to something else and you can't do that so I was trying to create an expression to get the same output but have been unsuccessful.


My expression is:

 

Client Count = COUNTROWS(ALLSELECTED('Global Sales and Pipeline Extra'[Client]))

 

Any help is appreciated.

 

Thanks

 

 

  • Anonymous's avatar
    Anonymous
    9 years ago

    And how have you written Client Count for that screenshot? COUNTA should give the same results as the count quick measure unless you've added something else.

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Why would you not just use counta?

     

    Client Count = COUNTA('Global Sales and Pipeline Extra'[Client])

    • hkrash0920's avatar
      hkrash0920
      Helper I

      The outcome is not right. I am assuming it is counting all the text characters in each cell. The column is all text. Thanks. 

      • Anonymous's avatar
        Anonymous
        Not applicable

        No, it's counting each non-blank row in the column given the filter context, including duplicate values. Maybe you want DISTINCTCOUNT? It's unclear how your data is structured or how exactly the incorrect results are incorrect.