Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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
Solved! Go to Solution.
Using your example, when a What If parameter is created, Power BI creates:
YearMultiplier = GENERATESERIES ( 0, 20, 1 )
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
Using your example, when a What If parameter is created, Power BI creates:
YearMultiplier = GENERATESERIES ( 0, 20, 1 )
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
Hi @OwenAuger ,
What if the case i want to show the [YearMultiplier Value] = 5 value in slicer itself, Is it possible to show the default value as 5 when i open the report? I am able to see the value in card visual, but my requirement is to show the 5 value in slicer?
You can select that particular value on the slicer in Power BI Desktop, then save & publish.
Does that work for you?
Hi @OwenAuger ,
Thanks a lot for your reply.
I cannot add the "YearMultiplier Value" measure in filter visual directly because the slicer expects the column "YearMultiplier". If i want to drag the measure "YearMultiplier value" in the slicer how we need to accomplish the requirement. Below in the screen shot where the static value 5555 (measure) should be populate in that slicer as single value by default when i open the report.
Hi @OwenAuger ,
Any upadte on my requirement. Is it possible to show the default value in slicer as single value automatically when we open the report. Is it possible using card visual but how to show in slicer?
Were you able to determine a solution? Based on a value in the dataset, I want to set one of the slicer values as selected (checked) when the report is called/opened in the service portal
Hi again @prakash11440278 - just clarifying, what I meant from my previous post is that you can select the desired default value on the slicer (by dragging or entering it), then save the report with this selection made and publish.
Then users who view the report will see this selection when they open the report (unless they change the slicer selection themselves).
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'?!
User | Count |
---|---|
128 | |
109 | |
100 | |
65 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |