Forum Discussion
UK_User123456
Resolver I
6 years agoGift Date that falls between two dates
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...
nandukrishnavs
Community Champion
6 years agoHi 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