Forum Discussion
Date based conditional formatting in a Power BI Table
- Anonymous1 year ago
Hi Danbo45689 ,
In PowerBI Desktop, we can get the data from that excel file, but we can't retain the original formatting.
I have created simple data.The steps to do this are as follows:
1. Create a measure, and you can modify it to suit your needs:
Color = VAR _day=DATEDIFF(MAX('Table'[Date]),TODAY(),DAY) RETURN SWITCH(TRUE(),_day>0&&_day<=30,1,_day>30,2)2. Conditional formatting of the table visual:
Use the value of the measure you just created as the standard:
3.Result:
Best Regards,
ZhuIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Danbo45689 ,
In PowerBI Desktop, we can get the data from that excel file, but we can't retain the original formatting.
I have created simple data.
The steps to do this are as follows:
1. Create a measure, and you can modify it to suit your needs:
Color =
VAR _day=DATEDIFF(MAX('Table'[Date]),TODAY(),DAY)
RETURN
SWITCH(TRUE(),_day>0&&_day<=30,1,_day>30,2)
2. Conditional formatting of the table visual:
Use the value of the measure you just created as the standard:
3.Result:
Best Regards,
Zhu
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Can you walk through the SWITCH Function and what that is doing?
what does the expression "_day" mean/where does it come from?
I'm looking to do something similar where I highlight the row of a table if the "Date Modified" column is within the last 8 days (including today).