Forum Discussion
Button dynamic color in Power BI
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
Can you please try the below steps.
1. Just Add two bookmark
a. Sales1b. 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 navigatorIf this answers your questions, kindly accept it as a solution and give kudos.
9 Replies
- rohit1991
Super User
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).
- Go to view >> Bookmark >> Create 4 Bookmarks
- Go to view >> selection >> Rename every button for easy understanding.
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
-
- mdaatifraza5556
Super User
Hi Analitika
If i am not wrong.
I am assuming you have two measure sales1 and sales2.
1. Create a field parameterChange the slicer into tile
2. Use the below dax for the resultSelected Sales =SWITCH(SELECTEDVALUE(Parameter[Parameter Order]),0, [Sales1],1, [Sales2])
ResultIF this answers your questions, kindly accept it as a solution and give kudos.
- Analitika
Post Prodigy
I am not using slicer but two buttons.
- mdaatifraza5556
Super User
Hi Analitika
Can you please try the below steps.
1. Just Add two bookmark
a. Sales1b. 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 navigatorIf this answers your questions, kindly accept it as a solution and give kudos.
- AnonymousNot applicable
Hi Analitika,
I would also take a moment to thank rohit1991 , jaineshp , mdaatifraza5556 for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Best reagrds,
Harshitha.- AnonymousNot applicable
Hi Analitika,
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We are always here to support you.
Regards,
Harshitha.- AnonymousNot applicable
Hi Analitika,
I wanted to follow up and see if you have had a chance to review the information that was shared. If you have any additional questions or need further clarification, please don’t hesitate to reach out. I am here to assist with any concerns you might have.
Regards,
Harshitha.
- Shahid12523
Community Champion
Bookmarks way (easy):
Create two bookmarks (Sale1 active, Sale2 active).
Assign each button to its bookmark.
This swaps button colors when clicked
- Shahid12523
Community Champion
DAX way (reusable):
Create a Button table with Sale1 & Sale2.
Use a slicer (hidden) to track selection.
Write a measure for button color and apply it to button Fill → fx.