Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
hi I want to ask, so I have data like this rental start and rental end, I want the output in the SLA column if today's date is close to the rental end date then the output will be "near overdue", if today's date has reached the rental end then the output will be "overdue" but if today's date has passed from the rental end date maybe about a month then the output will be "flag overdue"
Thanks in Advance!!
Solved! Go to Solution.
Here's a PowerQuery custom field expression and DAX equivalent. Prefer the PowerQuery version for performance.
As PowerQuery, note that I've assumed that I can generalize 1 month = 31 days:
if Duration.Days(Duration.From([rental end]-DateTime.Date(DateTime.LocalNow()))) <= -31 then "flag overdue" else if Duration.Days(Duration.From([rental end]-DateTime.Date(DateTime.LocalNow()))) < 0 then "overdue" else if Duration.Days(Duration.From([rental end]-DateTime.Date(DateTime.LocalNow()))) <= 14 then "rental near overdue" else "-"
Here's a DAX calculated column expression equivalent:
omg, it worked 😭 Thank you so much
Here's a PowerQuery custom field expression and DAX equivalent. Prefer the PowerQuery version for performance.
As PowerQuery, note that I've assumed that I can generalize 1 month = 31 days:
if Duration.Days(Duration.From([rental end]-DateTime.Date(DateTime.LocalNow()))) <= -31 then "flag overdue" else if Duration.Days(Duration.From([rental end]-DateTime.Date(DateTime.LocalNow()))) < 0 then "overdue" else if Duration.Days(Duration.From([rental end]-DateTime.Date(DateTime.LocalNow()))) <= 14 then "rental near overdue" else "-"
Here's a DAX calculated column expression equivalent:
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
11 | |
11 | |
10 | |
6 |