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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
iulian_buhat
Frequent Visitor

Need help generating a Dynamic Calendar Table

For a couple of reports I need a calendar table that generates all the dates from the day before the calculation to 6 months after. For now I have used the Calendar() dax command to do so, but when setting the dynamic dates for yesterday and six months after, dateadd and parallelperiod do not account for the change in month or year. I understand it can also be done in power query but I do not have enough experience with its functions to make one doing so.

 

Example: The calendar table calculated on 2020-09-01 should have all dates between and including 2020-08-31 and 2021-03-01

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@iulian_buhat , not very clear, you can create a calendar with dates like

 

Date = calendar(Min(Table[Date]) , Eomonth( max(Table[Date])+180,0))
Date = calendar(Min(Table[Date]) , Eomonth( today() + 180,0))

 

you can create various combinations.

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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@iulian_buhat , not very clear, you can create a calendar with dates like

 

Date = calendar(Min(Table[Date]) , Eomonth( max(Table[Date])+180,0))
Date = calendar(Min(Table[Date]) , Eomonth( today() + 180,0))

 

you can create various combinations.

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

While not exactly what I was looking for, I did manage to create it like so 

Calender = ADDCOLUMNS (CALENDAR (Today()-1,Today()+180), "DayOfWeekNumber", WEEKDAY ( [Date] ))
 
I just needed it to move forwards and backwars right, guess you can add to it like integers

@iulian_buhat , yes, the days you can add as an integer. Eomonth we use move to the end of the month and we play around with value and do +1 to get the start of the month . Thanks for sharing what you have done. 

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.