Forum Discussion

TaroGulati's avatar
TaroGulati
Helper III
4 years ago
Solved

If condition issue

Hello everyone,   I am having some difficulty of If condition result.   I have created this measure :  Value condition = var slicerdate = SELECTEDVALUE(Sheet2[Date]) var cal = IF(slicerdate ...
  • amitchandak's avatar
    4 years ago

    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
  • v-yalanwu-msft's avatar
    4 years ago

    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.