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
m1ke909
Frequent Visitor

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

1 ACCEPTED SOLUTION
AlB
Super User
Super User

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] )
    )
)

 

View solution in original post

2 REPLIES 2
AlB
Super User
Super User

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] )
    )
)

 

m1ke909
Frequent Visitor

Thank you! All working now!

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.