This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello all,
I would like to create new column an "aging interval". It should be a diff between the column "Posting date" and actual date and divided into the 6 month intervals (0-3M, 4-6M, 7-12M, 13-24M, 25-36M, >36M). Could anyone advise?
Thank you ina advance.
Jarda
Solved! Go to Solution.
Sample data would help but I would suggest creating a column using a SWITCH statement and use DATEDIFF something like:
Column = SWITCH(DATEDIFF([Date1],[Date2],MONTH),
0,"0-3M",
1,"0-3M",
2,"0-3M",
3,"0-3M",
4,"4-6M",
5,"4-6M",
6,"4-6M",
...
)
Hi Jarda,
You could have two calculated columns
DiffMonth = DATEDIFF([Posting Date],[Actual Date], MONTH)
Aging Interval = IF ( Table1[DiffMonth] <= 3,"0-3M",
IF (Table1[DiffMonth] <= 6, "4-6M",
IF(...)
)
)
A calcualted column like this should help:
Aging Interval =
VAR MonthsBetween =
DATEDIFF ( 'Table'[Start Date], 'Table'[End Date], MONTH )
RETURN
SWITCH (
TRUE (),
MonthsBetween <= 3, "0-3M",
MonthsBetween <= 6, "4-6M",
MonthsBetween <= 12, "7-12M",
MonthsBetween <= 24, "13-24M",
MonthsBetween <= 36, "25-36M",
">36M"
)
A calcualted column like this should help:
Aging Interval =
VAR MonthsBetween =
DATEDIFF ( 'Table'[Start Date], 'Table'[End Date], MONTH )
RETURN
SWITCH (
TRUE (),
MonthsBetween <= 3, "0-3M",
MonthsBetween <= 6, "4-6M",
MonthsBetween <= 12, "7-12M",
MonthsBetween <= 24, "13-24M",
MonthsBetween <= 36, "25-36M",
">36M"
)
Hi Jarda,
You could have two calculated columns
DiffMonth = DATEDIFF([Posting Date],[Actual Date], MONTH)
Aging Interval = IF ( Table1[DiffMonth] <= 3,"0-3M",
IF (Table1[DiffMonth] <= 6, "4-6M",
IF(...)
)
)
Sample data would help but I would suggest creating a column using a SWITCH statement and use DATEDIFF something like:
Column = SWITCH(DATEDIFF([Date1],[Date2],MONTH),
0,"0-3M",
1,"0-3M",
2,"0-3M",
3,"0-3M",
4,"4-6M",
5,"4-6M",
6,"4-6M",
...
)
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 24 | |
| 23 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 61 | |
| 35 | |
| 29 | |
| 23 | |
| 22 |