Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi,
I have a data table containing numbers. These correspond to some SQL that works out how days have passed from another date.
I have a calculated column that shows how many days have passed since the orginal date until today.
I want to highlight a cell in red if two criteria are met
I want to highlight the same cell in green if the following criteria are met
I have tried to create a measure bbut with no luck, any help would be greatly appreciated.
Hi @the606 ,
Let's say the new calculated column name is Column1. You have to create a measure like this..
Measure =
VAR diff =
DATEDIFF ( Table[orginal date], TODAY (), DAY )
RETURN
IF (
OR ( ISBLANK ( Table[Column1] ), diff >= 2 ),
"#bf212e",
IF ( OR ( Table[Column1] = 0, diff < 2 ), "#18a845" )
)
Use this measure in conditional formatting as a field value option.
Hi,
all of the fields are now red.
If possible then could you please share the pbix file so that I can look into it..?
@the606 , Create a new column like
New column =
var _diff = datediff([orginal date], today(), day)
return
Switch ( True(),
isblank([orginal date]) && [column] =0 , "Red",
[column] =0 , "Green"
_diff > 2, "Red" ,
"Green"
)
Use in conditional formatting with "Field Value" Option with Max aggregation
refer video for steps : https://www.youtube.com/watch?v=RqBb5eBf_I4
Hi,
im getting a an error "failed to resolve name 'diff. It is not a valid table, variable or fuction name.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
6 | |
4 | |
3 | |
3 |
User | Count |
---|---|
13 | |
11 | |
8 | |
8 | |
8 |