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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
FZOU
Helper IV
Helper IV

Calendar intervals

Hello,

 

I'm creating a DimDate in power bi desktop with dynamic intervals.

For exp : FIRSTDATE=X ; LASTDATE=X+5 years

To be more clear: FIRSTDATE=01/04/2020 ; LASTDATE=01/04/2025

 

In my case i'm facing a problem to add 5 years to my Starting date,this is my formula

 

DimDate = CALENDAR (FIRSTDATE(Sales[SalesCalendar]);DATEADD(Sales[SalesCalendar];5;YEAR))
 
My formula will not give me a single value for the LASTDATE,any one have an idea please ?
1 REPLY 1
amitchandak
Super User
Super User

@FZOU ,

try

DimDate = CALENDAR (FIRSTDATE(Sales[SalesCalendar]);date(year(FIRSTDATE(Sales[SalesCalendar]))+5,month(FIRSTDATE(Sales[SalesCalendar])),day(FIRSTDATE(Sales[SalesCalendar]))))

or

 

DimDate =
var _1 =FIRSTDATE(Sales[SalesCalendar])
return
CALENDAR (_1 ;date(year(_1 )+5,month(_1 ),day(_1 )))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.