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.
I am using a calculated column in PowerBI to identify whethere a date is older than 3 months from today.
My table is like so:
Date
30 July 2022 |
30 July 2022 |
30 July 2022 |
15 October 2021 |
28 February 2022 |
29 June 2020 |
29 December 2021 |
I am currently doing this manually, by entering the day that is 3 months ago, however I want to automate this so no manual adjustment. I have written as follows:
Solved! Go to Solution.
Hi @GeorgeR1 ,
This is something I would do in Power Query if possible. This will save the end user having to materialise calculated columns in memory at runtime, and I also personally find it much simpler to write.
Something like this in a new custom column should do it:
let
Date.Today = Date.From(DateTime.LocalNow())
in
if [Action Due Date] <= Date.AddMonths(Date.Today, -3) then "Overdue by 3+ Months"
else if [Action Due Date] < Date.Today then "Overdue"
else if Date.EndOfMonth([Action Due Date]) = Date.EndOfMonth(Date.Today) then "Due This Month"
else "Due Later"
Pete
Proud to be a Datanaut!
Hi @GeorgeR1 ,
This is something I would do in Power Query if possible. This will save the end user having to materialise calculated columns in memory at runtime, and I also personally find it much simpler to write.
Something like this in a new custom column should do it:
let
Date.Today = Date.From(DateTime.LocalNow())
in
if [Action Due Date] <= Date.AddMonths(Date.Today, -3) then "Overdue by 3+ Months"
else if [Action Due Date] < Date.Today then "Overdue"
else if Date.EndOfMonth([Action Due Date]) = Date.EndOfMonth(Date.Today) then "Due This Month"
else "Due Later"
Pete
Proud to be a Datanaut!
Brilliant, thank you. This is exactly what I was looking for.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
8 | |
7 | |
6 | |
6 |