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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Dynamic Title According to Multiple Selectors

Dear friends, how are you?

I have the following dynamic title, and I configured it in such a way that if I have in the "Channel" field the options "Retail" and "Institutions" are selected, the result gives me "Retail + Institutions", the same for the "Country" field, if I have "National" and "International" selected, I get "National+International".

As the GDP gives you the option that if no option in the field is selected, it assumes that all of them were selected, therefore, the same exercise as the previous one, no "Channel" selected, no "Retail+Institutions" or no "Country" selected, the result is "National+International".

The problem is that the title, when I have multiple options selected, throws me empty.

Graphic Title = "Sales"&SELECTEDVALUE(Total[Brand (CeBe)])&" en "&SELECTEDVALUE('Metrics'[Metric])&" canal "&
SWITCH(TRUE(),
SELECTEDVALUE(Total[Canal])="Retail","Retail",
SELECTEDVALUE(Total[Canal])="Institutions","Institutions",
SELECTEDVALUE(Total[Canal]) IN {"Retail","Institutions"},"Retail+Institutions",
"")
&" "&SWITCH(TRUE(),
SELECTEDVALUE(Total[Country])="National","National",
SELECTEDVALUE(Total[Country])="International","International",
SELECTEDVALUE(Total[Country]) IN {"National","International"}, "National+International",
"")
Thank you very much in advance.
Best regards!
2 REPLIES 2
barritown
Super User
Super User

Hi @MatiasBI1986

 

I guess the problem of your formula hides in the following fact:

SELECTEDVALUE ( <multiple values selected> ) = (BLANK)

 

There is an easy way to return the value you need if the choice is limited just to "Retail" and "Institutions" (or "National" and "International" ) by using the variable Part2 below, and the hard way, if you have more than just those values (see the variable Part3 below).

 

barritown_0-1701359936951.png

 

I've also attached the file so you can copy-paste some code if needed.

 

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

Syndicate_Admin
Administrator
Administrator

Problem solved:

This is the DAX

Graphic Title = "Sales"&SELECTEDVALUE(Total[Brand (CeBe)])&" in "&SELECTEDVALUE('Metrics'[Metric])&" "&
SWITCH(TRUE(),
SELECTEDVALUE(Total[Canal])="Retail","canal Retail",
SELECTEDVALUE(Total[Canal])="Institutions","Institutions Channel",
SELECTEDVALUE(Total[Canal])="","",
"Retail and Institutions")
&" "&SWITCH(TRUE(),
SELECTEDVALUE(Total[Country])="National","National",
SELECTEDVALUE(Total[Country])="International","International",
"")

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.