cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper I

## Rolling 25 Months

I have a datedim table and I want to add a column that will tell me if that date is between TODAY() and MONTH(TODAY())-25. I'm looking for a rolling 25 month range.

Thanks

1 ACCEPTED SOLUTION
Microsoft Employee

Hi @jdugas,

For your requirement, you’d better create a calendar table between TODAY() and MONTH(TODAY())-25. For instance, if today is 2017/1/6, you will create a calendar during 204/12/6-2015/1/6. Then get the minimum date form the calendar table to judge the date if in the range. I try to reproduce your scenario and get expected result.

First I try to create my sample data as follows.

TODAY() is 2016/1/6, so I create Calendar table using the formula: Calendar = CALENDAR(DATE(2014,12,6),DATE(2017,1,6))

Then create a calculated column to get the expected result using the formula below. “MINX('Calendar','Calendar'[Date])” returns “MONTH(TODAY())-25” date. It will display “Yes” if the date is in the range, and it displays “No” oppositely.

`Result = IF(AND(Table3[Date]<=TODAY(),Table3[Date]>MINX('Calendar','Calendar'[Date])),"Yes","No")`

Best Regards,
Angelia

2 REPLIES 2
Microsoft Employee

Hi @jdugas,

For your requirement, you’d better create a calendar table between TODAY() and MONTH(TODAY())-25. For instance, if today is 2017/1/6, you will create a calendar during 204/12/6-2015/1/6. Then get the minimum date form the calendar table to judge the date if in the range. I try to reproduce your scenario and get expected result.

First I try to create my sample data as follows.

TODAY() is 2016/1/6, so I create Calendar table using the formula: Calendar = CALENDAR(DATE(2014,12,6),DATE(2017,1,6))

Then create a calculated column to get the expected result using the formula below. “MINX('Calendar','Calendar'[Date])” returns “MONTH(TODAY())-25” date. It will display “Yes” if the date is in the range, and it displays “No” oppositely.

`Result = IF(AND(Table3[Date]<=TODAY(),Table3[Date]>MINX('Calendar','Calendar'[Date])),"Yes","No")`

Best Regards,
Angelia

Helper I

OK. Thanks for this update.

I'm not sure how I would create a calendar from a moving date. For example I always want to calculate the "Rolling 25 Months" from the "Last Full Month". I don't think your solution gets me there, unless I'm missing something.

Thanks

Jeremy

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.