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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ashmitp869
Helper II
Helper II

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
Helper II
Helper II

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors