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

View all the Fabric Data Days sessions on demand. View schedule

Reply
ashmitp869
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.