I am hoping someone can help with this issue. The main graph on my report is a bar graph showing the top 6 ranked salespersons. Surrounding that graph are four other visuals that provide details for whatever bar (salesperson) is chosen from the main graph. This works exactly as I want when something is chosen from the main graph.
However, if nothing is chosen, the four other visuals default to a summary view, which I do not want. Instead, I would like the four other visuals to either retain the last salesperson that was selected from the main graph or show the FIRST salesperson from the main graph. Is there a way to accomplish this?
If the above is not possible, then I would like the main graph to show the top 6 salespersons, but force the user to select one, defaulting to the first one if none is selected. Can this be done?
Thanks for your help.
it is possible by requires some DAX wizardry and it also may not be very intuitive to your users as what you are saying basically is the following, if nothing is selected in Chart One, display other charts as if bar one is selected for Chart One, although nothing in Chart One will indicate that Bar one is selected. if you still want to do it then this is what you need to do.
let's say your mesaure in other chart is sales. in that measure you need to check for selectedvalue() of the salesperson, if none is selected, then you need to rank your sales people by sales (assuming that's what is used in Chart One) and then calculcate the rest of the [sales] metric with that sales person id as a filter condition
so you create a SalesPersonID variable first thing in your calc, check selectedvalue(Salesperson...) and if it is not blank, use that ... if the value is blank, which means nothing or more than one is sleceted, then defaul to the first one.. the drawback is it will not be smart when a user selects more than one sales person. hope this helps
Thank you for your thorough reply. This is probably a basic question. After calculating the new measure, SalespersonID, how can I use it as a filter for the other visuals?
The other visuals include about 10 different metrics, I'm hoping I don't have to create calculated fields for each.
if you are relatively new to DAX then ten measures is what you will need to do, or you can try to create a calculation group using Tabular Editor tool, Calculation groups are really handy if you want to reuse certain logic form many measures, but it requires a little bit more DAX knowledge.
i have a video on calculation groups that you migh find useful, but right now there are some limitations in them from formatting perspective as well.
in short, what you are tryint to do is not a typical power bi behavior, so unfortunately, you will need to jump through some DAX hoops to get it to work
Before I jump into the calculation groups, are there any alternatives, such as using FIRST like is done for a card? Or, forcing a selection from the main graph?
Hi @bernmckin ,
This can be achieved.
Do you mind sharing your .pbix file?
Or report screenshots and sample data.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You can add CROSSFILTER() to your context modifiers. That allows you to change the filter direction for that measure, or ignore the filter altogether for a cross product.
This is a must watch for a message from Power BI!
Click here to read more about the December 2020 Updates!
Click here to read the latest blog and learn more about contributing to the Power BI blog!
Mark your calendars and join us for our next Power BI Dev Camp!.