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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
AU555
Helper I
Helper I

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:

2020-04-02 13_25_42-Installation overview try  - Power BI Desktop.png

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:

2020-04-02 13_28_51-Installation overview try  - Power BI Desktop.png

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? 🙂
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Thanks!

It's really hard to be specific without sample data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490.

 

It sounded like you wanted to change up your axis based on a measure which generally leads down the disconnected table trick route.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Thank you for the advice 🙂 @Greg_Deckler 

https://www.dropbox.com/s/s3oyirzfcxzhbth/example.pbix?dl=0 

This is the file to an example PBI I made, so far I use the buttons on the left side to switch between the views, but I would like to start using the slicer on the top. Can you help me how to solve it?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors