cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Bergh
Helper I
Helper I

Background clolor

Hi. I have a problem. I have a column that should show different background colors. I can not do this via condition control.


I have three columns. One column with Yes and No, one column with dates and a third with Datediff. I have combined the Yes and No column and the Date column into a separate column as in the picture. What I want is that if it says Yes or No and is over -14, it should be unchanged.

If it says No and is between -14 to 0, the background should be yellow, if it says No and is more than 0 to Max, the background should be red. How do I fix this??

Thanks
// Mattias

 

background_color.png

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Bergh ,

 

Please check the attached .pbix file. It's a sample. Please check if there are any differences between your scenario and the sample.

Icey_0-1649058001962.png

 

 

Best Regards,

Icey

 

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

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Bergh , You can create column meausre

COlor =

Var _max = max(Table[Datediff])

return

switch(True() ,

left(Max(Table[Column1]),2) = "No" && _max >=-14 && _max< 0 , "Yellow",

left(Max(Table[Column1]),2) = "No" && _max > 0 , "Red",

"White"

)

 

How to do conditional formatting by measure and apply it on pie? : https://youtu.be/RqBb5eBf_I4

 

Use this in conditional formatting using field value option

 

 

The problem I have now is that the "No" don't recognize in the code:

If I take away the "No" thing, the color work but when in the "No" code everything get White. Can it be the Max in LEFT(Max that is the problem?

Icey
Community Support
Community Support

Hi @Bergh ,

 

Please check the attached .pbix file. It's a sample. Please check if there are any differences between your scenario and the sample.

Icey_0-1649058001962.png

 

 

Best Regards,

Icey

 

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

Thanks!! It work now!!

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors