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
Riconic
New Member

Concatenating values and comparing them regardless of the order

Hello 

 

I have a column that concantenates a route: {Brussells, Paris, Madrid}.

 

I'd like to make a distinct count that would consider {Brussells, Paris, Madrid} = {Paris, Brussells, Madrid} as ONE route as I'd like to count the number of routes, regardless of the order.

 

Thanks for your help !!

1 ACCEPTED SOLUTION

Found it, it was merely to change the 'ORDER_By expression' argument in the concatenatex to have it sorted in alphabetical order instead of stop number.

Then the routes gets the same unique sequence string as they are sorted in alphabetical order.

 

 

View solution in original post

3 REPLIES 3
Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @Riconic ,
Trying creating a measure:
Countvalues= Calculate(COUNT(Route),Filter(table_name, Route="Brussells, Paris, Madrid" || Route="Brussells, Madrid, Paris" || Route="Madrid, Brussells, Paris" ||  Route=" Paris, Brussells, Madrid" || Route="  Paris, Madrid, Brussells" || Route="Madrid, Paris, Brussells" ))

I hope this helps!

Hi Tanushree_Kapse 

thanks for your answer.

 

Actually I should have been more specific.

The column "route" is a concatenateX of another column, the location address. 

The route is a sequence of different locations (from 2 to 5) with a separator.

The order does not matter in the sequence count, so A_B_C / B_A_C / C_A_B / C_B_A should be considered as the same route.

Since I have hundreds of possible routes, I can not hard code all the route sequences in the measure.

 

Thanks again !

Found it, it was merely to change the 'ORDER_By expression' argument in the concatenatex to have it sorted in alphabetical order instead of stop number.

Then the routes gets the same unique sequence string as they are sorted in alphabetical order.

 

 

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.

Top Solution Authors