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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Plump_Lil_Monk
Frequent Visitor

What-If Parameter

Hi

I have inherited a PBi dashboard which is a bit of a monster, But for this question, I have put together some mock data and visuals.

 

Scenario: 

Users show which activities they have been doing as well as, how many hours spent on each activity, which pay centre the hours will be placed against, and if the hours benefit either the client or the company they work for.

Plump_Lil_Monk_2-1680466689033.png

Visuals

I have two Matrix tables and a card.

Plump_Lil_Monk_1-1680466432305.png

Table 1 shows the users and a breakdown of the hours they have worked and to who the hours benefit.

Table 2 shows a breakdown of the activities categories that have been booked and benefit the company along with the total hours booked to each category by all employees.

Card Percentage of all of the hours that benefit the company.

 

Requirements

I need to be able to show how the figures would change if the number of hours spent on the, 'IT' activity or the 'Communication' activities, were changed to the contract and not to company. I would also then need to revert back to the current figures.

 

I believe that a What-If Parameter is required but I am unsure how to create a measure that would affect only one 'Booking Activity' at a time.

 

Can this be done?

 

Any help would be greatly appreciated. 

 

Plump

1 ACCEPTED SOLUTION
Migasuke
Super User
Super User

Hi @Plump_Lil_Monk ,

Try following logic:
1. Create your What-If parameter in Model section:

Migasuke_0-1680469979885.png

Migasuke_1-1680470019346.png


2.  Create a new measure. Measure should work only for IT and Communication, for the rest the hours will not change. You can try something like this:

Editable Hours =
var _Activity = SELECTEDVALUE(TableX[Booking Activities])
var _Hours = SUM(TableX[Hours Booked])

return

    SWITCH(
    _Activity,
    "Communication",_Hours * Parameter[Parameter Value],
    "IT",_Hours * Parameter[Parameter Value],
    _Hours)


FYI - this measure works also with Parameter Value, which is value connected to your What If table and slicer. Combining Parameter Value with Hours will solve your problem.

I Have an example in my own matrix.
As you can see, slicer has value = 10, so my hours in IT and Communication are 10x bigger. Other values are the same:

Migasuke_2-1680470482678.png

 

 

 



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

View solution in original post

2 REPLIES 2
Plump_Lil_Monk
Frequent Visitor

@Migasuke Thanks for your reply, much appreciated.

Apologies, I should have been more precise with my requirement, but I will take your example and expand.

I need to be able to show that if IT and Comms booking activity is increased by a certain amount to contract (let's say 10), how would that affect the overall percentage displayed in the % card?


Thanks

 

Thanks

 

Migasuke
Super User
Super User

Hi @Plump_Lil_Monk ,

Try following logic:
1. Create your What-If parameter in Model section:

Migasuke_0-1680469979885.png

Migasuke_1-1680470019346.png


2.  Create a new measure. Measure should work only for IT and Communication, for the rest the hours will not change. You can try something like this:

Editable Hours =
var _Activity = SELECTEDVALUE(TableX[Booking Activities])
var _Hours = SUM(TableX[Hours Booked])

return

    SWITCH(
    _Activity,
    "Communication",_Hours * Parameter[Parameter Value],
    "IT",_Hours * Parameter[Parameter Value],
    _Hours)


FYI - this measure works also with Parameter Value, which is value connected to your What If table and slicer. Combining Parameter Value with Hours will solve your problem.

I Have an example in my own matrix.
As you can see, slicer has value = 10, so my hours in IT and Communication are 10x bigger. Other values are the same:

Migasuke_2-1680470482678.png

 

 

 



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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