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
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors