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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AspireAlex
Frequent Visitor

Combining multiple 'What Ifs'

Hi,

 

I'm trying to create a model to analyse costs of our IT Service Desk using the new What If functionality to input hourly costs via sliders. I therefore need to calculate either [Time Taken] x [1st Line Support WhatIf Value] [Measure 1] or [Time Taken] x [2nd Line Support WhatIf Value] [Measure 2] depending upon which tier of support dealt with the request.

 

Measures [1] and [2] work fine in isolation however I am struggling as soon as I introduce an IF statement to conditionally select the WhatIf value.  I've tried adding a calculated column onthe original data source which looks like this:

 

Cost = IF(Data[Position] = "1st Line", WhatIf_1stLineCost[WhatIfParam1 Value], WhatIf_2ndLineCost[WhatIfParam2 Value])

 

As soon as I do this the values are blank.

 

Any suggestions on how to achieve this?  It seems like such a simple problem.  See below for an example of what I need the data to display like, the values in red is what I am trying to achieve.

 

whatif.png

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @AspireAlex,

 

You can refer to below sample to use position to switch the line value.

Measure = 
var currentPosition=LASTNONBLANK(Table1[Position],[Position])
return
MAX(Table1[Time Token])*SWITCH(currentPosition,"Line 1",MAXX(VALUES('Select 1'[Line 1]),[Line 1]),"Line 2",MAXX(VALUES('Select 2'[Line 2]),[Line 2]))

7.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @AspireAlex,

 

You can refer to below sample to use position to switch the line value.

Measure = 
var currentPosition=LASTNONBLANK(Table1[Position],[Position])
return
MAX(Table1[Time Token])*SWITCH(currentPosition,"Line 1",MAXX(VALUES('Select 1'[Line 1]),[Line 1]),"Line 2",MAXX(VALUES('Select 2'[Line 2]),[Line 2]))

7.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi Xiaoxin,

 

Thanks for your advice, I've managed to get it working now that I've created the CurrentPosition measure.

 

Alex

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.