Forum Discussion

govi's avatar
govi
Helper II
7 years ago
Solved

Count unique values

Hi,

 

I created this table:

 

Rows: userName

Values: Count of message

Filter: specific message

Filter: Score B

 

I want to count the unique userNames (14).

 

I need the number (14) in another calculation.

 

Can't figure how to do it.

 

Can anyone help?

Thanks!

govi

 

 

 

4 Replies

  • dedelman_clng's avatar
    dedelman_clng
    Community Champion

    You can use DISTINCTCOUNT against the table/column. You can also try COUNTROWS with SUMMARIZE, VALUES or DISTINCT

     

    UniqueIDs = DISTINCTCOUNT(Table[UserID])
    
    UniqueIDs = COUNTROWS(
               SUMMARIZE(Table, Table[UserID]) //or VALUES(Table[UserID] or DISTINCT(Table[UserID]
    )
    
    

    Hope this helps

    David

    • govi's avatar
      govi
      Helper II

      Thanks dedelman_cling

       

      But I don't know how to do that.

       

      Do I first have to create the table with a dax formula?

       

      I made the table I showed earlier with the use of the matrix visualization, I dont think I can use DISTINCTCOUNT agaainst that, do I?

       

      Thanks!

      govi