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.
Hi,
Couldn't find a previous post for this.
Say we have a table called Number
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?
Solved! Go to Solution.
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,
Happy to help!
@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
Happy to help!
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,
Happy to help!
Hi,
Hope this helps.
Thank you, that work splendid. Can you explain why the 1 was not being evaluated?
@Anonymous , Try a measure like
if( calculate(distinctcount(Table[number]), table[number] in {1,2})>=2,"1 and 2 are found", blank())
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".
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
101 | |
79 | |
73 | |
65 |
User | Count |
---|---|
141 | |
107 | |
100 | |
82 | |
74 |