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
M_SBS_6
Helper V
Helper V

Date Column based on selected period

Hi, 

I have a date column app_date of which I need to create my next column from. 

 

What I'm trying to do in this date column is create a rolling date from today's date. If today, I want to have a rolling 14 days and to call this "rolling current year".

 

In the same column, I want to the show the same period but 1 year ago and for this to be called "rolling previous year". 

 

So if we take app_date = today then show "rolling current year" back to 13 days prior (20th October) to today. Then the same principle for last year. If it falls either side of these 14 days, then blank. 

 

Any idea how I can do this please? 

1 ACCEPTED SOLUTION

@M_SBS_6 

maybe you can try this

New_date_flag = 
if(today()-'Table'[App_date]<=14,"Rolling current year",if(EDATE(today(),-12)-'Table'[App_date]<14&&EDATE(today(),-12)-'Table'[App_date]>=0 && year('Table'[App_date])=year(today())-1,"rolling previus year")
)

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

could you pls provide some sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




App_date.       New_date_flag

02/11/2023.    Rolling current year

01/11/2023.    Rolling current year

........

20/10/2023.    Rolling current year

19/10/2023.     (Blank) 

18/10/2023.     (Blank)

 

Then the following day it changes and moves forward one day so the 20/10/2023 will show as (blank).

 

The same principle for the same date period 1 year ago. I hope that makes sense. 

@M_SBS_6 

maybe you can try this

New_date_flag = 
if(today()-'Table'[App_date]<=14,"Rolling current year",if(EDATE(today(),-12)-'Table'[App_date]<14&&EDATE(today(),-12)-'Table'[App_date]>=0 && year('Table'[App_date])=year(today())-1,"rolling previus year")
)

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you so much for your help 

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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