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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.