Join 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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
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