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.
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
Solved! Go to Solution.
@Anonymous
The third optional parameter is exactly for his purpose
CONCATENATEX(<table>, <expression>, [delimiter])
Countries Concatenated = CONCATENATEX('Master Country','Master Country'[Master Country], " / ")
@Anonymous
The third optional parameter is exactly for his purpose
CONCATENATEX(<table>, <expression>, [delimiter])
Countries Concatenated = CONCATENATEX('Master Country','Master Country'[Master Country], " / ")
And once again I'm surprised how great PowerBI is! Thanks @Zubair_Muhammad , that indeed does the trick.
Cheers
Bas
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
96 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |