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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.