cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
BastiaanBrak Regular Visitor
Regular Visitor

What is intended behaviour for default value of 'What if' parameter?

hi all, I'm wondering how the default value that can be set for a 'What if' parameter is supposed to work. For example:  I've set up a What If parameter with values from 0 to 20 with increments of 1 and default value of 5. When I change the value in the slicer to 10, then close and re-open the report, the slicer does not re-set to 5. Also, suppose I change the slicer to 0, then publish the report; again it is the value set by me (0 in this case) rather than the 'default value' that is applied.

 

So where does default value come in?

Power BI test report available here if needed: https://we.tl/t-UrWhC1GT5B

 

Thanks, Bastiaan

1 ACCEPTED SOLUTION

Accepted Solutions
OwenAuger Super Contributor
Super Contributor

Re: What is intended behaviour for default value of 'What if' parameter?

Hi @BastiaanBrak

 

Using your example, when a What If parameter is created, Power BI creates:

  1. A table containing the allowed parameter values:
    YearMultiplier = GENERATESERIES ( 0, 20, 1 )
  2. A measure returning the selected parameter value:
    YearMultiplier Value = SELECTEDVALUE ( YearMultiplier[YearMultiplier], 5 )

The default value appears as the second argument of SELECTEDVALUE, and is returned if there is not exactly one value of YearMultiplier[YearMultipler] visible in the current filter context.

 

For example if multiple selections (or no selections) are made on a slicer for YearMultiplier[YearMultiplier], then [YearMultiplier Value] = 5.

 

The very first time a slicer is added for a What If Parameter column, it is an unselected state, so in your example [YearMultipler Value] = 5. You can test this by deleting the slicer and adding it again, and putting [YearMultiplier Value] on a card or other visual.

 

Regards,

Owen



Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




2 REPLIES 2
OwenAuger Super Contributor
Super Contributor

Re: What is intended behaviour for default value of 'What if' parameter?

Hi @BastiaanBrak

 

Using your example, when a What If parameter is created, Power BI creates:

  1. A table containing the allowed parameter values:
    YearMultiplier = GENERATESERIES ( 0, 20, 1 )
  2. A measure returning the selected parameter value:
    YearMultiplier Value = SELECTEDVALUE ( YearMultiplier[YearMultiplier], 5 )

The default value appears as the second argument of SELECTEDVALUE, and is returned if there is not exactly one value of YearMultiplier[YearMultipler] visible in the current filter context.

 

For example if multiple selections (or no selections) are made on a slicer for YearMultiplier[YearMultiplier], then [YearMultiplier Value] = 5.

 

The very first time a slicer is added for a What If Parameter column, it is an unselected state, so in your example [YearMultipler Value] = 5. You can test this by deleting the slicer and adding it again, and putting [YearMultiplier Value] on a card or other visual.

 

Regards,

Owen



Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




BastiaanBrak Regular Visitor
Regular Visitor

Re: What is intended behaviour for default value of 'What if' parameter?

hi @OwenAuger, thanks for that! Seems to me it could be called (even if just in my head) an 'initialisation value', rather than 'default value'?!

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 321 members 3,157 guests
Please welcome our newest community members: