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! Request now

Reply
Flawn
Helper III
Helper III

For each dupllicate in Column A, determine if two specific values 'x' and 'y' appear in column B

Hello everyone,

I'm trying to produce an interesting report: Column 'a' is essentially a client list. Whenever one of these clients appear multiple times in column a, we need to check if that client has two specific values that occur against them in Column 'b'. Let's call these values 'x' and 'y'.

 

We then need to calculate the percentage of distinct clients from that list for which both values 'x' and 'y' appear at least once somewhere in column b.

 

Here's an example:

ClientsApples or Oranges
JohnApple
LarryOrange
SueOrange
JohnApple
JohnApple
LarryApple
SueApple
LarryOrange
CarlApple


For this example we would need to identify that Larry and Sue have both values 'x' and 'y' (apple and orange) in column b - while the others do not have both values.

Therefore, 50% of clients have both the 'x' and 'y' value in column b.

Thanks again in advance for any help, let me know if you need any more info to resolve this. Unfortunately the actual data i'm working with is quite confidential, so I cannot share a real sample.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Flawn , Create a measure like

Divide(Countx(filter(summarize(Table, Table[Clients],"_1", distinctCOUNT(Table[Apples or Oranges])), [_1] =2), [Clients]), distinctCOUNT(Table[Clients]))

 

refer this video : https://www.youtube.com/watch?v=X5T4rIZovHk&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L&index=65

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Flawn , Create a measure like

Divide(Countx(filter(summarize(Table, Table[Clients],"_1", distinctCOUNT(Table[Apples or Oranges])), [_1] =2), [Clients]), distinctCOUNT(Table[Clients]))

 

refer this video : https://www.youtube.com/watch?v=X5T4rIZovHk&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L&index=65

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for the swift answer, but I have a followup that would be very much appreciated: What if we have a third column 'c', and we only want to calculate the percentage of distinct clients from the previous list for which both values 'x' and 'y' appear at least once somewhere in column b AND that have a value in column C.

To expand on the previous example:

ClientsApples or OrangesHungry
JohnAppleYes
LarryOrange 
SueOrange 
JohnApple 
JohnApple 
LarryAppleYes
SueApple 
LarryOrange 
CarlApple 

 


For this example we would need to identify that Larry and Sue have both values 'x' and 'y' (apple and orange) in column b - while the others do not have both values. Just the same as the previous calculation

But now we have to check column 'c' - Hungry. Because Larry also has at least one row that has a value filled for column C, they are included in the count.

Therefore, 25% of clients have both the 'x' and 'y' value in column b on top of at least one value in column C.

Thanks for expanding on your answer when you have the time. It's very much appreciated.

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