Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Tricky count measure

I have a tricky measure that I don't know how to proceed on. 

I have a table with key1 (table A) that is always unique to a person. But this person can have multiple of value2 that can be found in table A and B). I also have value3 (table B) which isn't unique either.

 

there's a one to many relationship between value2 from both table A & B. 

 

So key1 can have multiple of value2. Value2 can have multiple value3

 

I want to distinctcount all these value2, except where  key1 has value2 where value3 is the same for two rows (or more). 

Example:

Key1Value2Value3
1ABX
1BCX
1CDY
1DEZ

 

In the above case I want to count value2 only 3 times. Because it has a value3 that's the same on two rows. 

 

I'm not really sure how to proceed with this... Any pointers in the right direction would be very helpfull, thanks. 

 

(I then also have to apply some other filters in the calc but that should be the easy part...)

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Anonymous,

You can create a measure formula to count values in value3 field based on key1 group:

formula =
CALCULATE (
    COUNTROWS ( VALUES ( Table[Value3] ) ),
    ALLSELECTED ( Table ),
    VALUES ( Table[Key1] )
)

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

HI @Anonymous,

You can create a measure formula to count values in value3 field based on key1 group:

formula =
CALCULATE (
    COUNTROWS ( VALUES ( Table[Value3] ) ),
    ALLSELECTED ( Table ),
    VALUES ( Table[Key1] )
)

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors