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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
Resident Rockstar
Resident Rockstar

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
Resident Rockstar
Resident Rockstar

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.