Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Is there a way so that a table will have red rows (either font or backgrond) for dates older than today, current date orange and future dates green?
Solved! Go to Solution.
yes. conditional formatting option https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting
create a column like
Colour =
SWITCH(TRUE(),
Table[Date] < TODAY(), "red",
Table[Date] = TODAY(), "orange",
"green")
and use it as field rule in conditional formatting
Hi @StuartSmith
try
Contract_End_Date_Colour_Formatting_Columnn =
SWITCH(TRUE(),
'Carrier Matrix'[ContractEndDate] < TODAY(), "red",
'Carrier Matrix'[ContractEndDate] = TODAY(), "orange",
DATEDIFF(TODAY(), 'Carrier Matrix'[ContractEndDate], MONTH) <= 6 , "Blue",
"Green")
yes. conditional formatting option https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting
create a column like
Colour =
SWITCH(TRUE(),
Table[Date] < TODAY(), "red",
Table[Date] = TODAY(), "orange",
"green")
and use it as field rule in conditional formatting
@az38 Hi, your above solution worked great, and now trying to develop it. Is there a way so that if any date is between today and the next 6 months, its blue.
This would then highlight any date that falls between today and 6 months in the future.
Thanks in advance
So something like...
Contract_End_Date_Colour_Formatting_Columnn =
SWITCH(TRUE(),
'Carrier Matrix'[ContractEndDate] < TODAY(), "red",
'Carrier Matrix'[ContractEndDate] = TODAY(), "orange",
'Carrier Matrix'[ContractEndDate] > TODAY() || < 6Month in future , "Blue",
"Green")
Obviously the "< 6Month in future" is valid code, 😁
Hi @StuartSmith
try
Contract_End_Date_Colour_Formatting_Columnn =
SWITCH(TRUE(),
'Carrier Matrix'[ContractEndDate] < TODAY(), "red",
'Carrier Matrix'[ContractEndDate] = TODAY(), "orange",
DATEDIFF(TODAY(), 'Carrier Matrix'[ContractEndDate], MONTH) <= 6 , "Blue",
"Green")
Thats great and thanks
Thanks
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.