Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi Expert,
I need to create a calendar table ( starting from any date ) to the current week ending / end of the month.
Please advise how to get this working.
Dax help needed.
Many thanks!
Solved! Go to Solution.
hi, @Anonymous
Just try these two formula to create the Calendar Table:
to the current week ending:
Date2 = var _table= ADDCOLUMNS(CALENDAR(EOMONTH(TODAY(),-1),EOMONTH(TODAY(),1)),"WeekNum",WEEKNUM([Date])) return var _currentweekending=MAXX(FILTER(_table,[WeekNum]=WEEKNUM(TODAY())),[Date]) return CALENDAR("2019-01-01",_currentweekending)
to the end of the month
Date1 = CALENDAR("2019-01-01",EOMONTH(TODAY(),0))
Best Regards,
Lin
Hi @Anonymous
I'm not sure whether I understood your question properly, however, you can get a calendar table using below function. (go to modeling --> New Table). this will populate a calendar table based on the dates available on your data model.
CalendarFY = CALENDARAUTO(3) ## insert the FY end month so that you'll get the FY calendar.
Then using dax formulars you can add as many coloumns you want,
Examples:
Some of the functions are below,
Day = DAY(CalendarFY[Date]) MonthNo = MONTH(CalendarFY[Date]) Month = FORMAT(CalendarFY[Date],"MMMM") QuarterNo = INT((CalendarFY[MonthNo] + 2)/3) Quarter = "Q"&CalendarFY[QuarterNo] Year = YEAR(CalendarFY[Date]) FY = IF(CalendarFY[MonthNo]<=3,CalendarFY[Year],CalendarFY[Year]+1)
hi, @Anonymous
Just try these two formula to create the Calendar Table:
to the current week ending:
Date2 = var _table= ADDCOLUMNS(CALENDAR(EOMONTH(TODAY(),-1),EOMONTH(TODAY(),1)),"WeekNum",WEEKNUM([Date])) return var _currentweekending=MAXX(FILTER(_table,[WeekNum]=WEEKNUM(TODAY())),[Date]) return CALENDAR("2019-01-01",_currentweekending)
to the end of the month
Date1 = CALENDAR("2019-01-01",EOMONTH(TODAY(),0))
Best Regards,
Lin
Hi @Anonymous ,
I would create that table on excel then load it on your power bi report using the "Enter Data" feature in Query Editor.
Let me know if you need more info.
Cheers,
Robin