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
Anonymous
Not applicable

Combine text from one column in a measure

Hi,

I have a Master Country selection table that contains 4 names of countries:

 

Master Country

UK

North Ireland

Republic of Ireland

Spain

 

This table is linked with all kinds of other tables. In my reports I have a filter that users can use to select their country, and the right data pops up.

 

I now want the country name the report applies to, to be displayed in the title of these reports. To do that, I simply added a Card visual that’s showing the First result of the filtered Country table.

However, when I select multiple countries, it still only returns me the first result. For instance, if I select North Ireland, Republic of Ireland and spain, the card only returns North Ireland.

That’s why I created a measure to concatenate the country names:

 

Countries Concatenated = CONCATENATEX('Master Country','Master Country'[Master Country])

 

The result of that measure in the card visual is:

North IrelandRepublic of IrelandSpain

 

It doesn’t look that pretty as the country names are all connected to each other. I want to make that a bit more prettier by pulling them apart, and adding a delimiter. As an output for this example I’d be looking to get:

 

North Ireland / Republic of Ireland / Spain

 

Or in other words, it should show '[country] / [country] / [country]'

 

How to do that? Mind that the amount of countries selected can vary from 1 to 4, so in some cases it shouldnt even show a delimiter like / , and in some cases it has to show 4 of them.

 

Regards

Bas

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

The third optional parameter is exactly for his purpose

 

CONCATENATEX(<table>, <expression>, [delimiter])  

 

 

Countries Concatenated = CONCATENATEX('Master Country','Master Country'[Master Country], " / ")

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

The third optional parameter is exactly for his purpose

 

CONCATENATEX(<table>, <expression>, [delimiter])  

 

 

Countries Concatenated = CONCATENATEX('Master Country','Master Country'[Master Country], " / ")

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

And once again I'm surprised how great PowerBI is! Thanks @Zubair_Muhammad , that indeed does the trick.

 

Cheers

Bas

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.