cancel
Showing results for
Did you mean:

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

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.

like this:

Thank you,

1 ACCEPTED SOLUTION
Solution Sage

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

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

9 REPLIES 9
Solution Sage

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

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

Helper V

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:

when i done second part it gives error

What is wrong?

Solution Sage

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:

Helper V

Excel file:

Pbi:

Solution Sage

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?

Helper V

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

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?

Solution Sage

Solution Sage

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

Helper V

Hello @NickolajJessen

Coming from excel to pbi table.

Announcements

Power BI Monthly Update - November 2023

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

Fabric Community News unified experience

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

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