I need help / ideas for The Button “Click to See Trends”.
I would like this button to be activated / be usable only if the number of selections in “Statecode” slicer is Less than 3.
Because there are 23 statecodes, I dont want to display a line chart that has 23 lines. therefore I intend to limit it to any 3 statecodes that user can compare at any given point. If the selection is of more than 3 statecodes, the button should remain inactive.
I’m not sure you can do this with bookmarks, I can’t see a way to dynamically change the destination when the Action is set to Bookmark - someone may have more insight on this! However if you make them 2 seperate pages it should work, please see PBIX at the bottom.
Created a measure for the count of states selected:
State Count =
DISTINCTCOUNT( 'Data Table'[Statecode] )
Created a measure for the text of the button and set the button to use this measure for the text:
Button Text =
[State Count] > 3,
"Too many States Selected",
"Click to See Trends"
Created a measure to decide what page to go to and set this as the destination for the button:
And set the font colour and border properties of the button to use this measure. Then it will “disappear” if more than 3 are selected, however technically the user can still technically click it if they hovered over the area.
I too attempted with a measure that that would change the colour of the button if more than 3 were selected. - and my last resort would have been to make it - all white or merge in background colour, which was not a satisfactory solution since anyone could accidentally click that area and end up seeing an ugly line chart
But I didnt think of creating a separate page and conditionally changing the destination - This will do the job exactly as i planned.
great solutions here - and I’m going to add one additional note for anyone finding this topic in the future - there is also the drill-through button (which would also require a second page for the drill-through action)
One of the nice things about the drill-through action is that it has a disabled state (they selected more than 3 items)
When i had attempted the use of drill through, Asfar as i can remember, it didnt work for me since i wanted the button to activate only when slicer options were selected, and this option was activating he button even when a bar, of a bar chart was clicked. and think it prompted for just a single data point selection.
@DavieJoe Please do share if it works when you attempt with drill through.
For future reference for anyone on landing on this topic, I am sharing the working sample, similar to my actual file.