cancel
Showing results for
Did you mean:
Highlighted
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.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: Combining multiple 'What Ifs'

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]))```

Regards,

Xiaoxin Sheng

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

For learning resources/Release notes, please visit: | |
2 REPLIES 2
Community Support Team

## Re: Combining multiple 'What Ifs'

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]))```

Regards,

Xiaoxin Sheng

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

For learning resources/Release notes, please visit: | |
Frequent Visitor

## Re: Combining multiple 'What Ifs'

Hi Xiaoxin,

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

Alex

Announcements

Power BI Super User, Greg Deckler, explains

#### Power Platform Summit North America

Register by September 5 to save \$200

#### Back to School Contest

Engage and empower students with Power BI!

#### Watch Sessions On Demand!

Continue your learning in our online communities.

Top Ideas
Top Kudoed Authors
Users Online
Currently online: 44 members 1,067 guests
Recent signins: