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
Nun
Resolver I
Resolver I

Dynamic text with the switch formula

Hello,

I have a table 

Month   City 

Jan         "Paris"

Feb         "Madrid"

Mar        "Berlin"

Apr        "Zurich"

Now I created a dynamic text with switch formula:

SWITCH(TRUE(), VALUES('Table[City]) = "Paris", "Paris - " & VALUES('Table'[Month]) & " " & YEAR(TODAY()),VALUES('Table[City]) = "Madrid", "Madrid - " & VALUES('Table'[Month]) & " " & YEAR(TODAY())...
The dinamyc text, if one month is selected, is: Paris - Jan 2022.
now I have a slicer with the months. If the user select one month, the dynamic text shows correctly the city, the month and the year.
If the user select more than a month, for example Jan and Feb, the dynamic text returns an error: " a table with multiple values...".
How can I change the switch formula considering that 1 or more month (text) can be selected?
 
Thanks!
1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Nun ,

 

You could use CONCATENATEX() function.

Measure = CONCATENATEX('Slicer','Slicer'[Column1],"-")

vjaywmsft_0-1661939746727.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @Nun ,

 

You could use CONCATENATEX() function.

Measure = CONCATENATEX('Slicer','Slicer'[Column1],"-")

vjaywmsft_0-1661939746727.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Thanks Jay, I solved the issue creating a measure with

CONCATENATEX. A measure which contains a double concatenatex (one for the city and one for the month) & 
YEAR(TODAY()) (to get the year)...in this way I can get the correct city and correct month when the user uses the filters City and Month.
 
Br.
Shreeram04
Resolver III
Resolver III

Hi @Nun 

 

Try a Quick Measure called "Concatenated list of values".

 

Shreeram04_0-1661492767400.png

Thanks

Hi @Shreeram04 , thanks for your quick reply. I tested it, unfortunately the concatenated list of values doesn't  fully satisfy my need.

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.