Forum Discussion

AU555's avatar
AU555
Icon for Helper I rankHelper I
6 years ago
Solved

Using what-if parameters (instead of bookmarks)

Hi all,

hope all of you are doing fine 🙂 I have been working with PBI for some time and also some tasks with what of parameters, but only used what-if parameters in very simple examples. Now I would like to use parameter instead of my bookmarks..

So for now I have report looking something like this:

So I have a bar chart and on the left I have three bookmarks depending on what should be in the legend of the bar chart. So for example when I have selected Split by name: a bar chart which has in the legend a column "name". When I click on split by month the legend will be based on the column "Month" etc...

 

However, as I have also some other bookmarks in my original repor, it creats a bit confusing look, so I would like to create this possibility with what if parameter:

Instead of the bookmarks I would like to have a slicer that is offering these 3 options. These 3 field are original variables from my dataset (so no calculated columns).

 

So what I have done so far is I created a parameter: 

Parameter = GENERATESERIES(1, 3, 1)
 
which then includes also measure: 
Parameter Value = SELECTEDVALUE('Parameter'[Parameter])
 
and I created a calculated column to match 1,2,3 number to my desired outputs so: name, month and order:
Split by = IF('Parameter'[Parameter] = 1, "Name", IF('Parameter'[Parameter]=2, "Month", IF('Parameter'[Parameter]=3, "Order")))
 
and now, I am strugelling how to use these fields in my report, so it becoms functioning. Normally I would use the parameter value in measure that I am using in the Value field in bar chart, but here the values are staying the same over the different views, just the legend should change based on the selected parameter. 
 
Can anybody help me with this? 🙂

4 Replies