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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

DAX multiple selectedvalue slicer

Hi,

 

Couldn't find a previous post for this.

 

Say we have a table called Number

numbers.png

 

When both 1 and 2 are selected in slicer, I want the text to read "1 and 2 are found".

Why is the following measure not working properly?

 


testpicture.png

1 ACCEPTED SOLUTION
ibarrau
Super User
Super User

Hi. The problem is that the 1 is not evaluated in that statement. It's only evaluating the 2. That's why it works with the two.

Try adding the condition for both:

Measure = 
IF ( 
    1 IN VALUES('Table'[Column1]) 
    && 2 IN VALUES('Table'[Column1])
    , "1 and 2 selected"
    , "False statement" 
)

Hope this helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

View solution in original post

7 REPLIES 7
ibarrau
Super User
Super User

@Anonymous , In DAX the && or || operator will only work to separate two complete conditions with its operations. You can't use "and" to separate numbers or make smaller conditions. You always have to write the complete statatement for each one. You can think them as AND() or OR() functions. They need the complete statement inside the function.

Hope this make sense


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

ibarrau
Super User
Super User

Hi. The problem is that the 1 is not evaluated in that statement. It's only evaluating the 2. That's why it works with the two.

Try adding the condition for both:

Measure = 
IF ( 
    1 IN VALUES('Table'[Column1]) 
    && 2 IN VALUES('Table'[Column1])
    , "1 and 2 selected"
    , "False statement" 
)

Hope this helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Anuja_Chaudhari_0-1705648085008.png

 

Hi,

Hope this helps.

Hema_Gupta_0-1705576314293.png

 

 

Anonymous
Not applicable

Thank you, that work splendid. Can you explain why the 1 was not being evaluated? 

amitchandak
Super User
Super User

@Anonymous , Try a measure like

if( calculate(distinctcount(Table[number]), table[number] in {1,2})>=2,"1 and 2 are found", blank())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

No, that did not solve it. selecting anything will now give the "1 and 2 are found" message.

 

It can't be a calculate type measure, as the list to choose from might also be text. 

So instead of Numbers 1,2,3,4,5,6

Let's assume it's A,B,C,D,E and when specifically A and B is chosen, I want "A and B are chosen". 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.