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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
MartinPedersenP
Regular Visitor

Meassure to count if column A and B are identical but column C is different

Hello there

 

I have a dataset that contains three columns [UserID],[JobType],[JobID]

 

Is it possible to create a meassure that counts how many row pairs pr. UserID has had the same UserID and JobID, but JobType should be different in the two rows.

 

I have tried asking ChatGPT and tried googling, but I cant seem to find a way to do it.

 

I have also tried duplicating my table so I have JobType 1 in the first table and JobType 2 in the second, but I still cant get it to create a correct output.

 

By any means is it possible?

1 ACCEPTED SOLUTION

I don't understand, is this result wrong?

Screenshot_5.png

View solution in original post

7 REPLIES 7
Ahmedx
Super User
Super User

pls try this

Screenshot_3.png

 

UserIDJobIDJobType
100071084529A
10007921715

B

10007967500B
10007936291B
10007933696B
10007930134B
10007913749B
100071085439B

 

The first user that pops up with column being 1, yet none of the JobIDs are matching

I don't understand, is this result wrong?

Screenshot_5.png

I didn't expect this when I initially asked but if you take a look at this table

UserIDJobIDJobType
1200A
2300A
1200B
1400A
1400B
1400B

There is a double entry for UserID 1 on JobID 400 with one JobType A and Two JobType B.

Is it possible to ignore the doublet?

At first I tried copying your code into my old measure and that resulted in some weird behavior. I added a new column and pasted the code and it seems to work. Thanks 😄 

DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

try this:

 

Measure =
CALCULATE(COUNTROWS(
FILTER('Table Name',
CALCULATE(MAX('Table Name'[Column A]))=CALCULATE(MAX('Table Name'[Column B]))
&&CALCULATE(MAX('Table Name'[Column A]))<>CALCULATE(MAX('Table Name'[Column C])))))
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

I don't think that would work. I will try to be as explicit as possible:

Is it possible to create a meassure that counts how many row pairs pr. UserID has had the same UserID and JobID, but JobType should be different in the two rows.

 

So for Row1 and Row2 UserID should be the same and JobID should be the same, but JobType should be different.

UserIDJobIDJobType
1200A
2300A
1200B
1400A
1400B

 

In this case I want the measure to show that UserID 1 has 2 row pairs that match on both UserID and JobID, but different JobType

 

I hope this makes sense, I am still not sure if it is possible.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.