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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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