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
Shubha_Udyawar
Frequent Visitor

Conditional formatting for colours in Stacked column chart

Hi,

I want to conditional format a stacked column chart. I mean , the negative values should be turned to red. I am able to do it when i have a single value column but when i add one more column, the conditonal colour formatting option goes away. Can anyone help?

Thank you in advance.

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Shubha_Udyawar ,

 

That has to do with the caractheristics of the chart type when adding additional columns the values start to be stacked so the condittional stops working.

 

If you are only adding 2 columns one work around can be create 4 measures (2 for positive and 2 for negatives)

SUM NEGATIVE 1 = IF(SUM('Table'[Column1])>0 ;BLANK();SUM('Table'[Column1]))
SUM POSITVE 1 = IF(SUM('Table'[Column1])<0 ;BLANK();SUM('Table'[Column1]))
SUM NEGATIVE 2 = IF(SUM('Table'[Column2])>0 ;BLANK();SUM('Table'[Column2]))
SUM POSITIVE 2 = IF(SUM('Table'[Column2])<0 ;BLANK();SUM('Table'[Column2]))

 

Now just colour your 2 negative measure as red.


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



View solution in original post

6 REPLIES 6
MFelix
Super User
Super User

Hi @Shubha_Udyawar ,

 

That has to do with the caractheristics of the chart type when adding additional columns the values start to be stacked so the condittional stops working.

 

If you are only adding 2 columns one work around can be create 4 measures (2 for positive and 2 for negatives)

SUM NEGATIVE 1 = IF(SUM('Table'[Column1])>0 ;BLANK();SUM('Table'[Column1]))
SUM POSITVE 1 = IF(SUM('Table'[Column1])<0 ;BLANK();SUM('Table'[Column1]))
SUM NEGATIVE 2 = IF(SUM('Table'[Column2])>0 ;BLANK();SUM('Table'[Column2]))
SUM POSITIVE 2 = IF(SUM('Table'[Column2])<0 ;BLANK();SUM('Table'[Column2]))

 

Now just colour your 2 negative measure as red.


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



Olá Miguel Félix,

É possível usar uma alternativa semelhante com 2 colunas e 4 cores? uma das colunas pode ter 3 cores diferentes.

Thank You

Boa noite,

 

Em principio sim a única questão que se coloca é qual o limite para que cada cor fique ativa então em vez de ser o formato anterior teria de ser algo similar:

 

SUM NEGATIVE 1 = IF(SUM('Table'[Column1])>0 ;BLANK();SUM('Table'[Column1]))
SUM POSITVE until 1000 = IF(SUM('Table'[Column1])>0 && SUM('Table'[Column1])<= 1000; SUM('Table'[Column1]);BLANK();SUM('Table'[Column1]))
SUM POSITVE above 1000 = IF(SUM('Table'[Column1])>1000
; SUM('Table'[Column1]);BLANK();SUM('Table'[Column1]))

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 ,

Thank you and my apologies too. I have a correction in my question, what if one of them is a column and the other one is a measure ? Can i still use this as a solution?

@MFelix ,

Thank you so much, that did work for me.
Now, the colours are showing as i wanted but there are 4 legends instead of two. So I think ill just go ahead and turn off the legends.

Glad I could help, please mark the correct answer.


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.