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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
JustinDoh1
Post Prodigy
Post Prodigy

How to show value when selected with other value(s)?

I am trying to show value(s) when I select more than one value.

I have upload my PBIX file here.

 

I have this DAX that states that "if "ALI" is selected from tblScore[Location], it displays "ALI", otherwise none.

 
ALI Cover = IF(SELECTEDVALUE(tblScore[Location]) in {"ALI"},"ALI","")
 
JustinDoh1_0-1734136414666.png

But, when I select more than one value, nothing would shows up.

JustinDoh1_1-1734136573639.png

 

How do I modify the exisitng DAX to accomplish that?

 

Also, I have created three separate DAX for each spot, but is there a way to combine into one DAX expression by chance?

 

Thanks.

1 ACCEPTED SOLUTION
shafiz_p
Super User
Super User

Hi @JustinDoh1  Try this:

ALI Cover = 
IF(
    NOT ISFILTERED(tblScore[Location]),
    "",
    IF(CONTAINSSTRING(CONCATENATEX(tblScore, tblScore[Location], ","), "ALI"), "ALI", "")
)

 

Output:

shafiz_p_0-1734147275487.png

 

 

Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

 

Best Regards,
Shahariar Hafiz

View solution in original post

4 REPLIES 4
JustinDoh1
Post Prodigy
Post Prodigy

@shafiz_p Hi Shafiz, Thank you so much for your help.

You DAX is almost working, but I am wondering, is there way for all of three signs show up when

user selects "Select all".

JustinDoh1_0-1734375508786.png

I have uploaded the updated PBIX with three measures (Covers) updated.

Thank you!

DataNinja777
Super User
Super User

Hi @JustinDoh1 ,

 

My observation is that you do not need to repeat the three boses, and can use ConcatenateX to achieve your required output.  

 

Cover = 
IF(
    ISFILTERED(tblScore[Location]),
    CONCATENATEX(
        VALUES(tblScore[Location]),
        tblScore[Location],
        ", "
    ),
    BLANK()
)

 

DataNinja777_0-1734151169402.png

 

I have attached a pbix file for your reference.

 

Best regards,

 

@DataNinja777  Thank you so much for your feedback.

I guess due to the spacing issue and alignment to the each parameter, I would need to create separate covers for each.

At this moment, I am trying to find a way for all three signs would show up when users select "Select all".

JustinDoh1_2-1734377200508.png

 

Please find my latest & updated file here that has three separate measures included.  Thank you!

shafiz_p
Super User
Super User

Hi @JustinDoh1  Try this:

ALI Cover = 
IF(
    NOT ISFILTERED(tblScore[Location]),
    "",
    IF(CONTAINSSTRING(CONCATENATEX(tblScore, tblScore[Location], ","), "ALI"), "ALI", "")
)

 

Output:

shafiz_p_0-1734147275487.png

 

 

Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

 

Best Regards,
Shahariar Hafiz

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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