Forum Discussion
Visualization (Buttons and Slicers)
- 1 year ago
You could just create another conditional formatting measure but this time should be applied to the callout value of the buttons.
Slicer Highlight Color = IF ( SELECTEDVALUE ( MonthsOnly[Month Short] ) IN VALUES ( Dates[Month Short] ), "white" --#ffffff for hexadecimal )
Hi danextian, thank you so much for your help! I really appreciate it.
There are a few things I still need help with.
Firstly, all the columns I’m using are from the same table. I’ve already created a Date Hierarchy consisting of Year, Quarter, Month, and Day.
What I’d like to achieve is the following behavior:
- When a user selects a Quarter (e.g., Q2), the respective Months within that quarter — April, May, and June — should also be automatically selected or highlighted.
- Similarly, when a user selects a Month (e.g., June), the corresponding Quarter (in this case, Q2) should also be selected or highlighted, even if only one month from that quarter is selected.
Is there a way to implement this kind of synchronized selection behavior in Power BI? I’d really appreciate any guidance or suggestions you can offer.
Thanks again!
Have you checked if visual interactions are enabled for those slicers? With or without hierarchy, as long as the interaction is enabled, you will get the same behaviour as in the image in my initital response. Also, please check if indeed the columns are from the same table - it could be a column with the same name but from another table.
- aziffarhan1 year agoRegular Visitor
Hi danextian, thanks again for your help!
The interactions are currently disabled, and there are a few reasons why I chose to do that.
I want the Month slicers to be selectable, not just displayed after clicking on a Quarter. At the same time, I need all buttons/slicers to be visible at all times. For example, when I select Q1, I want Jan, Feb, and Mar to be highlighted or selected, but I don’t want the other months to be hidden. I want all months to remain visible, regardless of the selection.
I’d really appreciate your help in figuring out how to achieve this behavior. Also just to add, a feature where I can select any months that I want without having to select a quarter is also needed. Whenever the user select a month, the respective quarter will also be selected, while the other quarter will be shown but not selected.
Feel free to let me know if more context is needed for your understanding.Thank you!
- danextian1 year agoSuper User
If you disable the interaction then you can't really expect them to sync. There is currently no option to cross-highlight instead of cross-filtering the interaction between slicers. The default behaviour of a slicer to is to cross-filter even non-slicer visuals. That said, your workaround is to use dimensions that are not directly related to each other - quarter coming from the regular table and months from a months only table but still related to fact. Your diagram would look like below.
Cross-highligting will be done via conditional formatting. Create a measure that will check whether the months in MonthsOnly are currently visible in Dates table
Slicer Highlight Color = IF ( SELECTEDVALUE ( MonthsOnly[Month Short] ) IN VALUES ( Dates[Month Short] ), "#ADD8E6" )Crossfiltering/highlighting from months to quarter also uses a measure in a visual filter or conditional formatting.
Please see the attached sample pbix.
- aziffarhan1 year agoRegular Visitor
Hi danextian, thanks for your help, again.
Is there any way that I could make the font color in the button slicer becomes white after it has been highlighted. For example, when Q1 is selected, Jan, Feb and March will be highlighted and the font will be white (#FFFFFF).
I would appreciate it if you could help me with these inquiries.
Thank you.