Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I'm relatively new to Power BI and finding my feet slowly.
I'm wanting to replicate something that is possible in Excel, and am unsure how to go about doing this in Power BI
I have a table with various values, but the important one, is the due date. I want to use conditional formatting to highlight any cell where that date is in the past. I've figured out conditional formatting for a few other functions on different Tables within Power BI but this one has me totally stuck.
In Excel, I would just highlight the range, use a formula to determine that i want to highlight any cells that contain a value prior to today, and it just works.
Could anyone share the steps i would need to take to do something like this in Power BI? Even better if it could be a 2-step format, say, Overdue by 30 days = Orange, and Overdue by more than 30 days = Red
I've included a very crude snip of how i would want it to look (from excel as my example) of both the desired outcome, and the steps i can take in Excel. I'm just stuck with how to replicate it here in a Power BI Report. Help very much appreciated!
Solved! Go to Solution.
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.
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).
Thanks for that, I'll try it out and reply with my results.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
74 | |
73 | |
56 | |
38 | |
31 |
User | Count |
---|---|
84 | |
63 | |
63 | |
49 | |
45 |