Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
lookingfo123
New Member

Categorize a year column

I have a column that tracks earliest retirement dates (its a date column). I need a new column that will break these out in to ranges. For example if the earliest retirement date is 02/02/2025, this should be categorized in the 2-3 year (from today's date) category. Can anyone help me with the dax for this? 

1 ACCEPTED SOLUTION
Timuran
Resolver I
Resolver I

 

Hello @lookingfo123 ,

 

You can do something as follow :

 

 

 

Category = SWITCH(YOUR_TABLE[DATE].[Year] - YEAR(TODAY()), 0 , "This year", 1 || 2, "2 to 3 years", 3 || 4 , "4 to 5 years", "Older")

 

 

OR 

 

Category = CONCATENATE(YOUR_TABLE[Date].[Year] - YEAR(TODAY()), " year")

Have a nice day

 

View solution in original post

1 REPLY 1
Timuran
Resolver I
Resolver I

 

Hello @lookingfo123 ,

 

You can do something as follow :

 

 

 

Category = SWITCH(YOUR_TABLE[DATE].[Year] - YEAR(TODAY()), 0 , "This year", 1 || 2, "2 to 3 years", 3 || 4 , "4 to 5 years", "Older")

 

 

OR 

 

Category = CONCATENATE(YOUR_TABLE[Date].[Year] - YEAR(TODAY()), " year")

Have a nice day

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors