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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

Calendar Table to reflect till End of Week / End of Month

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!

 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

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

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
dilumd
Solution Supplier
Solution Supplier

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.

Calendar.PNG

 

 

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:New column.png

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)
v-lili6-msft
Community Support
Community Support

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

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

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

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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