cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rich_coutinho
Resolver II
Resolver II

CALENDAR DAX: Starting on 01/01/2017 and finishing in the last day of previous month

Hi All, 

 

I have a calender table create based on DAX : 

CALENDAR = CALENDAR ("01/01/2017", today())

But what I would like is to have the "end date" of the calendar as the last day of previous month. Example: 

 

Today is 11/02/2019, on my calendar I'd like to have all dates between 01/01/2017 and 31/01/2019. I'd like to create this in a DAX to not amend the end of calendar each month. 

 

It's necessary, because my database is based on the previous month, and I dont want to give for the End user the option on my slicer of the current month as the data wont be there until the end of the month. 

 

I was trying to use DATEADD function but it had no sucess. 

 

Any clue how can I have in a DAX the return of the last day of previous month based on today to create my autocalendar ?

1 ACCEPTED SOLUTION
AlB
Super User III
Super User III

Hi @Rich_coutinho

 

Try this:

 

CalendarTable =
CALENDAR ( "01/01/2017", EOMONTH ( TODAY (), -1 ) )

View solution in original post

1 REPLY 1
AlB
Super User III
Super User III

Hi @Rich_coutinho

 

Try this:

 

CalendarTable =
CALENDAR ( "01/01/2017", EOMONTH ( TODAY (), -1 ) )

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Top Kudoed Authors