Forum Discussion

m1ke909's avatar
m1ke909
Frequent Visitor
7 years ago
Solved

Unique field count help!

New to Power BI here so this could be a silly question. 

 

I need to count the amount unquie text fields within another field and I'm not sure where to start? 

Example where C3 is retuning what I would like and C1 & C2 are the data fields I'm working with.

 

Any help would be greatly appreicated.

 

C1    C2     C3

SH1   A      3

SH1   B      3

SH1   C      3

SH2   A      1

SH2   A      1

SH3   C      2

SH3   A      2

SH4   B      2

SH4   C      2

  • Hi m1ke909 

    Create a new calculate column, where Table0 is the table you show: 

    C3 =
    COUNTROWS (
        CALCULATETABLE (
            SUMMARIZE ( Table0; Table0[C1]; Table0[C2] );
            ALLEXCEPT ( Table0; Table0[C1] )
        )
    )
    

     

2 Replies

  • AlB's avatar
    AlB
    Community Champion

    Hi m1ke909 

    Create a new calculate column, where Table0 is the table you show: 

    C3 =
    COUNTROWS (
        CALCULATETABLE (
            SUMMARIZE ( Table0; Table0[C1]; Table0[C2] );
            ALLEXCEPT ( Table0; Table0[C1] )
        )
    )