cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tejapowerbi123
Helper IV
Helper IV

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

 

1 ACCEPTED SOLUTION
richbenmintz
Super User I
Super User I

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)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
richbenmintz
Super User I
Super User I

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)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors