Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Conditional Formatting with diff requirements

I've been scanning the boards for this specific concern, and can't seem to find the right solution. Tried a few measures suggested, but it doesn't work because I have several values with different conditions.

 

Right now, I have a table that has a bg color condition that for any 120+ days open, it's in red, and any below that is in green. Recently, I got SLA conditions that says IF JOB LEVEL = n, Days Open = n.

 

So the conditions I have are, these job roles and their targets:

Nogstai_0-1654682026886.png

So I was looking at for example, the Days Open says 85. If it's any Senior Manager and below, the background color in the table is going to be red, but if the job role is a Director, then it's still green.

Nogstai_1-1654682219006.png

 

Is it possible to create one measure for this? I've been trying OR() conditions on a few measures, but it's not working.

 

Appreciate the help!

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try the measure.

 

Color = 
VAR target =
    CALCULATE (
        SUM ( Roles[Days Open Target] ),
        TREATAS ( VALUES ( 'Table'[Job Level Des] ), Roles[Roles] )
    )
RETURN
    IF ( SUM ( 'Table'[Days Opened] ) > target, "red", "green" )

vkkfmsft_0-1655174688331.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
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

6 REPLIES 6
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try the measure.

 

Color = 
VAR target =
    CALCULATE (
        SUM ( Roles[Days Open Target] ),
        TREATAS ( VALUES ( 'Table'[Job Level Des] ), Roles[Roles] )
    )
RETURN
    IF ( SUM ( 'Table'[Days Opened] ) > target, "red", "green" )

vkkfmsft_0-1655174688331.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Never mind, I was able to fix it. The Days Open Target was in Text on my file. I switched it to whole number. Appreciate the help! Is there a way I can use other colors aside from Green/Red? Can I put in Hexa codes?

Hi @Anonymous ,

 

Yes, you can. You just need to change the color to the desired Hexa codes, like this.

 

Color = 
VAR target =
    CALCULATE (
        SUM ( Roles[Days Open Target] ),
        TREATAS ( VALUES ( 'Table'[Job Level Des] ), Roles[Roles] )
    )
RETURN
    IF ( SUM ( 'Table'[Days Opened] ) > target, "#E389B9", "#288BA8" )

 

Best Regards,
Winniz

Anonymous
Not applicable

Hi! Appreciate the help. I was able to create the measure, but it's greyed out and can't be selected as a field value

Nogstai_1-1655219713703.png

 

Make it return 1 or 0 in sted of "Red" and "green". Then it will work 🙂 

NickolajJessen
Solution Sage
Solution Sage

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.