Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ashmitp869
Post Partisan
Post Partisan

help with the dax expression to calculate depending on dim value ?

Hi all,

How can I achieve

when [Service Group Level 0] is "REVENUE" then [Actual Amount] 

when  [Service Group Level 0] is "COSTS + OVERHEADS" then [Cost Amount] 

ashmitp869_0-1710736461937.png

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

You can use nested IFs, or the syntax sugar version SWITCH.

 

Result = SWITCH([Service Group Level 0],"REVENUE",[Actual Amount],"COSTS + OVERHEADS",[Cost Amount])

View solution in original post

3 REPLIES 3
ashmitp869
Post Partisan
Post Partisan

getting an error. what can be the reason ?

ashmitp869_0-1710795871628.png

 

a measure needs an aggregation.  use MAX([Service Group Level 0])  , for example.

lbendlin
Super User
Super User

You can use nested IFs, or the syntax sugar version SWITCH.

 

Result = SWITCH([Service Group Level 0],"REVENUE",[Actual Amount],"COSTS + OVERHEADS",[Cost Amount])

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.