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.
Hello,
Please help me to make that whenever I press on button it changes color. I have two buttons sale1 sale2. Default is selected sale1 If I select sale2 then color changes of sale1 and sale2 buttons. How I could achieve this?
Hi @Analitika
If i am not wrong.
I am assuming you have two measure sales1 and sales2.
1. Create a field parameter
Change the slicer into tile
2. Use the below dax for the result
Result
I am not using slicer but two buttons.
Hi @Analitika
Can you please try the below steps.
1. Just Add two bookmark
a. Sales1
b. Sales2
2. Now Go to insert and select Bookmark navigator.
Here is your result.
You can adjust your background as per your preference using Format navigator
Hi @Analitika
Could you please follow below steps:
Add buttons
Insert >> Buttons >> Blank >> rename to Sale1_off (grey style).
Duplicate it >> rename to Sale1_on (give it your selected color, e.g., brown).
Do the same for Sale2 >> Sale2_off (grey) and Sale2_on (brown).
Put the two “on” buttons exactly over the “off” ones (same position/size).
Selecitons:
Go to View >>Selection.
In the Bookmarks pane, select Sales 1 off.
In the Selection pane, hide Sales 2 on and Sales 1 off (click the eye icons).
Go back to the Bookmarks pane, right-click Sales 1 off.
In the menu, uncheck Data (so only Display/Current page are ticked).
Click Update.
2. For Sales 2 off
Stay in View >> Selection.
In Bookmarks pane, select Sales 2 off.
In the Selection pane, hide Sales 1 on and Sales 2 off.
Right-click Sales 2 off in the Bookmarks pane >> uncheck Data >> click Update.
Apply Action on Sales 1 off button
Apply Action on Sales 2 off button
Hey @Analitika,
Looking for a way to create dynamic button colors in Power BI? Here's a practical solution that works:
1. Create a Measure for Button State
Selected Button =
IF(SELECTEDVALUE('ButtonTable'[ButtonName]) = "Sale1", "Sale1", "Sale2")
2. Set Up Button Actions
3. Dynamic Color Formatting
Button Color =
IF([Selected Button] = "Sale1",
IF(MAX('ButtonTable'[ButtonName]) = "Sale1", "#0078D4", "#F3F2F1"),
IF(MAX('ButtonTable'[ButtonName]) = "Sale2", "#0078D4", "#F3F2F1"))
4. Apply to Both Buttons
Pro Tips:
This approach gives you the toggle effect you're looking for without complex workarounds. The buttons will automatically switch colors based on selection state.
Fixed? ✓ Mark it • Share it • Help others!
Best Regards,
Jainesh Poojara | Power BI Developer