Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi All,
I wanted to be able to find what categories a date I have in my data set falls into. So based on the end of each month, I would like to be able to use the end of the month to calculate 24/48/60/60+ months back and then if one of the dates falls into this bracket then it would put the category of 0-24 and then the same with 25-48 and so on, my data set looks like below:
| Date | 31/10/2019 |
| Gift Date | Category |
| 30/10/2019 | 0-24 |
| 21/01/2019 | 0-24 |
| 01/05/2018 | 25-48 |
| 24/01/2008 | 60+ |
Any help would be much appreciated.
TIA
Hi @UK_User123456 ,
First, you can define a base date
BaseDate = DATE(2019,10,31)
Now you can create a calculated column.
Category =
VAR difference =
DATEDIFF ( 'Table'[Gift Date], [BaseDate], MONTH )
VAR category =
IF (
difference >= 0
&& difference <= 24,
"0-24",
IF (
difference >= 25
&& difference <= 48,
"25-48",
IF (
difference >= 49
&& difference <= 60,
"49-60",
IF ( difference > 60, "60+", "" )
)
)
)
RETURN
category
Output
Regards,
Nandu Krishna
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!