Forum Discussion

aravindh10's avatar
aravindh10
Icon for Helper I rankHelper I
7 years ago
Solved

if and switch statement in measure

i am not able to write switch and if in meaure.someone help me with example i am able to write it in column  Slab = IF((APL[APL.ITEM_STATUS_CD] <>"C" && [Due Days] <0 ),"Overdue", IF((APL[APL.ITE...
  • v-danhe-msft's avatar
    7 years ago

    Hi aravindh10 ,

    You could try to use below formula:

    Slab = IF((CALCULATE(MAX(APL[APL.ITEM_STATUS_CD])) <>"C" &&CALCULATE(SUM( [Due Days])) <0 ),"Overdue",
    IF(CALCULATE(MAX(APL[APL.ITEM_STATUS_CD])) <>"C" && CALCULATE(SUM( [Due Days]))>=0&& CALCULATE(SUM( [Due Days]))<31,"0-30"))

    Result:

    Regards,

    Daniel He