cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
koray
Helper V
Helper V

Help for Conditional Formating

Hello,

 

I want the values under the months to be green if they are lower R21, Blue if they are between R21 and B22, and red if they are higher than B22.

 

koray_0-1654081465062.png

like this:

koray_1-1654081682621.png

 

Thank you,

1 ACCEPTED SOLUTION
NickolajJessen
Super User
Super User

Allright, your "data" isn't really data. It's already a report. You should consider transforming your data to a more appropriate format.

That being said, here's how to do it with your current format.

Create a measure than checks if its lower than R21 or higher than B22 as below

NickolajJessen_3-1654085208291.png

 

 

Use the measure to format the specific coloum. Note that you need to do this to every column. jan, feb, mar, etc.

NickolajJessen_2-1654084850396.png

 

View solution in original post

9 REPLIES 9
NickolajJessen
Super User
Super User

Allright, your "data" isn't really data. It's already a report. You should consider transforming your data to a more appropriate format.

That being said, here's how to do it with your current format.

Create a measure than checks if its lower than R21 or higher than B22 as below

NickolajJessen_3-1654085208291.png

 

 

Use the measure to format the specific coloum. Note that you need to do this to every column. jan, feb, mar, etc.

NickolajJessen_2-1654084850396.png

 

hi @NickolajJessen 

 

Measu like as below:

color =
var C1 =SWITCH(
SUM(Sheet1[January]) < SUM('Table 1 (KPI2022)'[R21]), TRUE(), 1) //one is green

var C2 =SWITCH(
SUM(Sheet1[January]) < SUM('Table 1 (KPI2022)'[B22]), TRUE(), 2) //one is green

Return
COALESCE(C1,C2,3)
 
second part is like as below:
koray_0-1654088214389.png

when i done second part it gives error

koray_1-1654088262546.png

 

What is wrong?

It seems you have more than one table, as you are summing on sheet1 and table one

I'm gonna try and ask this again:

How is your data structured?




Hi @NickolajJessen 

 

Excel file: 

koray_0-1654151654555.png

Pbi:

koray_1-1654151690263.png

 

SUM(Sheet1[January]) < SUM('Table 1 (KPI2022)'[R21])

How is you data loaded into Power Bi? I see you are referencing Sheet1 and Tabel 1 (KPI2022)

Do you have more than one table? Can you send a screenshot of your datamodel?

Hi @NickolajJessen 

 

Yes my fault you are totally right. Sorry for this. It's fixed now, thank you very much.

 

koray_0-1654156858627.png

 

 

But now I realized that in some values, I need to color the opposite.

We did this:

I want the values under the months to be green if they are lower R21, Blue if they are between R21 and B22, and red if they are higher than B22.

But on some of my values, I want to colorize the opposite. I will try to explain in more detail.

We said that if the value is greater than R21, the background should be green. Yes this is true for some fields eg Oee, rft micro etc.

But this is not true for energy, waste, water. It has to be red for them. For this reason, can I differentiate it by specifying Area?

Sure, you can add an additional condition

NickolajJessen_0-1654158080696.png

 

NickolajJessen
Super User
Super User

What type of visual is this? How is you data structured?

Hello @NickolajJessen 

 

Coming from excel to pbi table.

koray_0-1654083032523.png

 

Helpful resources

Announcements
Power BI Show Episode 10 Recap

The Power BI Community Show

Watch the playback when Amit Chandak, a Power BI Super User, demos how to use Field Parameters to make reports more dynamic.

Power BI Dev Camp Session 26

Ted's Dev Camp - October 6, 2022

Watch the playback of Session 26 with Ted Pattison!

Health and Life Sciences Power BI User Group

Health and Life Sciences Power BI User Group

Power BI specialists at Microsoft have created a community user group where customers in the provider, payor, pharma, health solutions, and life science industries can collaborate.

Ignite 2022

What's Next at Microsoft Ignite 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Top Solution Authors