Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
HaveeshPerla_1
Helper II
Helper II

How to apply toggle button for JSON themes switch?

Hi Team,

 

I've built two json themes according to my project requirement. As per power bi there's only way to apply is one after other. But now I've got a requirement to apply both the themes simulteneously using a toggle button on the dashboard itself which would act as switching between the themes. 

 

Please help me in finding out a solution for this.

 

Regards,

Haveesh

10 REPLIES 10
HaveeshPerla_1
Helper II
Helper II

Hi @MFelix ,

 

can you let me know what exactly has happened in there? All I could understand is that a shape was placed and with button feature having a field value of colour code which was given in the table it's being switched. Is this what happeneing, or correct me if i've misunderstood. 

The color is being used on the conditional formatting, that will make the change of color when you select one option or the other on the button.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



But in this case it would be a manual contional approach but not the json theme approach which I was expecting. Can you let me know if there's any possibility where this would be acheived through json themes and not the manual conditional approaches.

 

Regards,  

Hi @HaveeshPerla_1 ,

 

You cannot have Themes being applied using JSON and a button to make the switch between themes.

 

The Json is an overal setting for your report and can only be setup when you are editing the report not on view mode. So for this to happen you need to have your code changed in a condittional formatting, as you refer manual option.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix 

 

In that case, can you please elobarate the steps of how to add the conditional change of background colour with a button and can that change the bckground of all the pages in the report or only to that specific page?

 

Regards,  

MFelix
Super User
Super User

Hi @MFelix ,

 

The references you shared are manual based approach and the youtube video also a manual approach and works for a single page. But my requirement was different, where I have the JSON theme files and I'm looking for a option where i can have two json files being switched using a toggle button cause that would impact for the whole dashboard irrespective of pages.

 

Please suggest me on this. 

That option is not available currently on Power BI, you can only change a theme of a report in edit mode, since the users don't have access to the edit mode they cannot do it with a button.

 

You need to have both themes "defined" on the visualizations and pages and then the users can select them.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Can you elaborate what exactly this line "You need to have both themes "defined" on the visualizations and pages and then the users can select them." mean?

 

what's the way to define both the themes at a time on the visualizations so that users can select?

Please see the file attach

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.