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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
SH-VE
Helper IV
Helper IV

Dynamic Date table ending at current year

Hello All,

 

I am using CalendarAuto function for creating dynamic date table. Since my data model has 2021 data, this calendar table is getting extended to 2021 (Screenshot #1). I want to change it to calendar function which should only go upto end of the the current year (e.g. 2020 till Dec 31, 2020 and 2021 from Jan 1, 2021).

This is becasue , this calendar is getting used in another 'next month ' query (screenshot#2) . So if its dec 2020, the next month it is considering is Jan -2022.

 

 

#1

Screenshot#1Screenshot#1

 

#2Screenshot#2Screenshot#2

 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

You could change your Calendar table or that measure.  For the Calendar you could use 

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

 

or in the measure, you could just use DATE(YEAR(TODAY()),12,31) in place of your EDATE

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

You could change your Calendar table or that measure.  For the Calendar you could use 

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

 

or in the measure, you could just use DATE(YEAR(TODAY()),12,31) in place of your EDATE

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thanks for the response . This worked.

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.