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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

End Date in my calendar tables.

Hello

How are you?

 

My name is Andre and I am a power professional

I am using the code  = Date.EndOfYear(DateTime.Date(DateTime.FixedLocalNow()))

I am trying to set up an automatic End Date in my calendar tables.  Base on that, we are in 2020 now and the table is showing the months until December 2020 and when we will be in 2021, the calendar table will be an automatic update to December 2021??

Is my assumption correct?

 

 

Can anyone pls help me ?

1 ACCEPTED SOLUTION

Hi,

 

After you apply your original code, it will automatically generate a table as below:

36.PNG

Then you can try this calculated table:

Calendar = CALENDAR(DATE(2020,1,1),MAX(Query1[Query1]))

The result will show the date from 2020/1/1 to the current year last date.

etc. if current year is 2021, the calendar table date will expand to the 2021/12/31.

Hope this helps.

 

Best Regards,

Giotto

 

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi All,

 

I am working on forecasting for shipments and created a calendar table. What should be my end date?

 

Should my end date be the last date of my forecasting model or ladt date of my last shipment in the data set?

v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try this calculated table:

Calendar =
CALENDAR (
    DATE ( YEAR ( TODAY () ), 1, 1 ),
    DATE ( YEAR ( TODAY () ), 12, 31 )
)

Hope this helps.

If my answer has solved your issue, please mark it as a solution for others to see.

Thanks!

 

Best Regards,

Giotto

Anonymous
Not applicable

Hello @v-gizhi-msft 

 

Thanks for your reply.

I think my main question is: if I only use this Date.EndOfYear(DateTime.Date(DateTime.FixedLocalNow())), nothing else.

when we are in 1/1/2021, this function will display the whole year 2021?

 

Thanks

 

Hi,

 

This code will only show the last day of current year not the whole year, see this:

31.PNG

And i advise you using DAX expression to show the whole year as my posted upper.

 

Best Regards,

Giotto

Anonymous
Not applicable

Hello @v-gizhi-msft 

 

In my calendar table, I have the whole year of 2020

See below pls2020-04-16_14-22-00.png

 
 
 

Hi,

 

After you apply your original code, it will automatically generate a table as below:

36.PNG

Then you can try this calculated table:

Calendar = CALENDAR(DATE(2020,1,1),MAX(Query1[Query1]))

The result will show the date from 2020/1/1 to the current year last date.

etc. if current year is 2021, the calendar table date will expand to the 2021/12/31.

Hope this helps.

 

Best Regards,

Giotto

 

amitchandak
Super User
Super User

In case you have generated calendar using dax

This can be done

 Calendar = Calendar(Date(2019,01,01),Date(year(today()),12,31))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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