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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Persistent color and table conditional coloring

Hello,

I have a couple things I can't figure out regarding conditional formating and colors

 

-Is there a way to bind a color to a field value? I have a True/false field in my report that I use a lot; I would like to always have Green/red colors when I use this field as a legend when I create a new chart. That seems like a basic functionality for report consistency but I can't find it.  

 

-In Table conditional formating, how can I format based on the same value ? I want to have a green/red cell based on the value of the same boolean but it seems it only work with aggregation or color code. Do i need to have a 1/0 field or a color code field in addition to my boolean to achieve this ?

 

Thanks for your support

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

From my test, conditional formatting could be applied for Data color ,but it seems not reach the same output as in table.

12.16.1.00.gif

I suggest you use custom theme instead like this:

12.16.1.0.jpg

Please take a look at the different output shown below:

 

12.16.1.3.PNG

Here is the pbix file.

 

But this is at idea/feedback level alone. Please let the power bi community to know this things and give your votes at power bi site's feedback - https://ideas.powerbi.com/ideas/idea/?ideaid=31fd95a4-308f-4a28-a3d4-10489b973642

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Eyelyn Qin

View solution in original post

4 REPLIES 4
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

From my test, conditional formatting could be applied for Data color ,but it seems not reach the same output as in table.

12.16.1.00.gif

I suggest you use custom theme instead like this:

12.16.1.0.jpg

Please take a look at the different output shown below:

 

12.16.1.3.PNG

Here is the pbix file.

 

But this is at idea/feedback level alone. Please let the power bi community to know this things and give your votes at power bi site's feedback - https://ideas.powerbi.com/ideas/idea/?ideaid=31fd95a4-308f-4a28-a3d4-10489b973642

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Eyelyn Qin

MFelix
Super User
Super User

Hi @Anonymous ,

 

To do this you can create a measure that will do the condittional formatting on all your visualizations. You need to do something similar to:

 

Condittional Formatting =
SWITCH(SELECTEDVALUE(Table[Column]);
True(); "Green";
False(); "Red"

)

The just use this measure on all the formatting fields you needs.

 

Two remarks about the measure above:

  • I have use SELECTEDVALUE but for example only this can be used with a measure value with a MAX, MIN, and so on, the trick is to pickup the value you need and on the rest of the parameters set the different options and corresponding colours
  • The "Green" and "Red" part can be changed to HEX codes that have the following pattern "#000000"

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



Anonymous
Not applicable

Hi Miguel,

Thanks for the tip, having this in a measure works works well for formating my table. 

 

However in other charts (ex: stacked bar charts or donut), I don't see any way to use this, I have no formula option in the "Data color" pane when I have a field used as a legend.  So I see no way of permanently bind a field value to a color. As a previous Tableau and Qlik user, that seems like a serious shortcoming for PowerBI .

When you use the legend on a visualization some of the features aren't available that is the case of the condittioonal formatting you need to use measures or columns on your visualization. 

 

I don't know the exact setup of your model but if you create a measure for true and false you are able to then make the condittioonal formatting 


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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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