Forum Discussion

tejapowerbi123's avatar
6 years ago
Solved

How to write IF or SWITCH in MEASURE?

Hello Community,

Can anyone suggest me, how can I write below formula in MEASURE?

 

Final = IF (Master[Grand Request]>0,Master[Grand  Request]-RELATED('Grant Master'[Grand Total]),0)

Thanks

 

  • Hi tejapowerbi123 

     

    Couple things, 

    1. determine the appropriate aggregation to be used for the base columns and create measures for them, then just reference the measures in your [Final] Measure 

    Grand_Request = sum(Master[Grand Request])
    Grand_Total = sum('Grant Master'[Grand Total])
    
    Final = IF ([Grand_Request]>0,[Grand_Request]-[Grand_Total],0)

     

1 Reply

  • richbenmintz's avatar
    richbenmintz
    Resident Rockstar

    Hi tejapowerbi123 

     

    Couple things, 

    1. determine the appropriate aggregation to be used for the base columns and create measures for them, then just reference the measures in your [Final] Measure 

    Grand_Request = sum(Master[Grand Request])
    Grand_Total = sum('Grant Master'[Grand Total])
    
    Final = IF ([Grand_Request]>0,[Grand_Request]-[Grand_Total],0)