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

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.