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
zahidah_mabd
Helper I
Helper I

Check if duplicated unique value has mismatched values in other columns

Hi, 

I have two columns [Position ID] and [Position Location] in the table 'Position'.

 

There are some duplicates on the position ID. 

 

I have created a column to count the duplicates for position ID
Duplicated Position_Code =
Var Position_ID = [Position ID]
RETURN

CALCULATE(
COUNTROWS('Position'),
all('Position'),
'Position'[Position ID] = Position_ID
)

The output will show the number of times the Position ID is in the data.

 

So now I want to check if the duplicated position ID has the same location for each data or not.

This is an example of duplicated position ID data with multiple locations.

Position IDPosition LocationDuplicated Position_ID
1130New York3
1130New York3
1130Ohio3
1456Nashville2
1456Boston2


So basically the duplicated ID would be

Duplicated Position_ID <> 1

But im not sure how to get that measure.
Can anyone help me with this? 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@zahidah_mabd 

is this what you want?

Column = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Position ID]=EARLIER('Table'[Position ID])&&'Table'[Position Location]=EARLIER('Table'[Position Location])))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@zahidah_mabd 

is this what you want?

Column = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Position ID]=EARLIER('Table'[Position ID])&&'Table'[Position Location]=EARLIER('Table'[Position Location])))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




It wasnt what I was looking for at first, but I did find it useful and managed to  get the output that I want from your solution. Thank youuuu

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.