The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi guys, I have a use case that I can use some community inputs for.
So I need a couple of rectangular buttons with labels like "Sales > 50,000" or "Customers who have defaulted on the payments", etc.
And when these are clicked on, their color becomes green from transparent and thus the user knows that this filter is active.
Thanks a lot for answering and Im excited to see all the creative ways this can be done!
Solved! Go to Solution.
@burakkaragoz This looks so gpt-like 🙄
I would suggest to use 'Blank button'/ in-built Bookmark navigator plus 'bookmarks'. Capture each state on each Bookmark, which would be easier than using SELECTEDVALUES.
thanks
Mason
Hi @johnmenx ,
May I ask if you have gotten this issue resolved?
If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.
Regards,
Chaithra.
Hii @johnmenx ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithra.
Hi @johnmenx ,
Thank you @MasonMA for providing a response.
We would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Regards,
Chaithra.
@burakkaragoz This looks so gpt-like 🙄
I would suggest to use 'Blank button'/ in-built Bookmark navigator plus 'bookmarks'. Capture each state on each Bookmark, which would be easier than using SELECTEDVALUES.
thanks
Mason
Hi @johnmenx ,
Cool use case! You can totally fake "button filters" in Power BI Desktop, though it’s not super straightforward out of the box. Here’s how I usually do it:
1. Create a helper table with your button labels. Something like:
ButtonFilter = DATATABLE( "Filter", STRING, {{"Sales > 50000"}, {"Defaulted Customers"}, {"All"}} )
No need to connect this to your model.
2. Add a slicer visual using this table. Set the orientation to "Horizontal" or "Tile" in the slicer settings so it actually looks like buttons.
3. To make your visuals respond to the filter, create a measure like:
SelectedFilter = SELECTEDVALUE(ButtonFilter[Filter], "All")
Then, in your other measures, use SWITCH or IF to change the calculation based on which button is clicked. Example:
SalesAmountFiltered = SWITCH( [SelectedFilter], "Sales > 50000", CALCULATE(SUM(Sales[Amount]), Sales[Amount] > 50000), "Defaulted Customers", CALCULATE(COUNTROWS(Customers), Customers[Status] = "Defaulted"), CALCULATE(SUM(Sales[Amount])) )
4. For the color change: Power BI doesn’t let you dynamically style slicer buttons (yet), but you can change the "Selected color" in the Slicer format panel to green—so the selected button will look active.
It’s not perfect, but looks/works pretty well for dashboards! If you need totally custom visuals, you could look into Deneb or custom visuals, but above is the fast way.
Hope that helps! Let us know if you get stuck or want a more advanced setup. Good luck!
translation and formatting supported by AI