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
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
Solution Sage
Solution Sage

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 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.