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
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
Solution Sage
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

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
Solution Sage
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

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
Solution Sage
Solution Sage

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
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.