cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amulder
Helper I
Helper I

Validate 2 columns with same data in different order as equal

I have data with street intersections entered in different fields - Street and Cross Street.  I am combining the 2 values in the Intersection1 column using CONCATENATE.  See data screenshot

 

amulder_1-1638479858869.png

I need a way to say values with the same street names but in different order are the same.  For example Main and Hastings is the same intersection as Hastings and Main.  Is there an easy way to do this?

1 ACCEPTED SOLUTION

This works exactly as required, thank you!

View solution in original post

2 REPLIES 2
ebeery
Super User
Super User

Hey @amulder , one approach might be to just sort the two streets in a predictable fashion (alphabetically) on each entry, so that even if the streets are reversed they are still sorted into a consistent order.

Here's an example of what I mean:

ebeery_0-1638493194846.png

 

Intersection = 
Var _FirstStreet = MIN(Intersections[Street], Intersections[Cross Street])
VAR _SecondStreet = MAX(Intersections[Street], Intersections[Cross Street])

Return
_FirstStreet & " " & _SecondStreet

This works exactly as required, thank you!

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!