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.
Hello everyone,
I am having some difficulty of If condition result.
I have created this measure :
Solved! Go to Solution.
@TaroGulati , Try like
Value condition =
var slicerdate = maxx(ALLSELECTED(Sheet2), Sheet2[Date])
var cal = IF(slicerdate >TODAY(), sum(Sheet2[Value]),sum(Sheet2[Value +10]))
return cal
Hi, @TaroGulati ;
Because your slicer is [month name] ,and your measure is SELECTEDVALUE(Sheet2[Date]) ; so it not right. you could modify the measure as follows:
Value condition =
var cal = IF(MONTH(SELECTEDVALUE('Sheet2'[month name])&" 1") >=MONTH(TODAY()), [Value Measure],[value +10 measure])
return cal
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @TaroGulati ;
Because your slicer is [month name] ,and your measure is SELECTEDVALUE(Sheet2[Date]) ; so it not right. you could modify the measure as follows:
Value condition =
var cal = IF(MONTH(SELECTEDVALUE('Sheet2'[month name])&" 1") >=MONTH(TODAY()), [Value Measure],[value +10 measure])
return cal
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@TaroGulati , Try like
Value condition =
var slicerdate = maxx(ALLSELECTED(Sheet2), Sheet2[Date])
var cal = IF(slicerdate >TODAY(), sum(Sheet2[Value]),sum(Sheet2[Value +10]))
return cal
Hi @TaroGulati
You have used SELECTEDVALUE(Sheet2[Date]) to compare with TODAY(), but your slicer is limited by month. You could create a new measure with SELECTEDVALUE(Sheet2[Date]) and you will find it returns BLANK.
Your slicer needs to be accurate to days, or use months in conditions for comparison. It is also possible to get the maximum/minimum date of the selected month and compare it to today. Anyway, you need uniform units of comparison.
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 |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
152 | |
120 | |
102 | |
87 | |
68 |