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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
joeort
Frequent Visitor

Calendarauto but include dates from previous fiscal years

I've used CALENDARAUTO(3) to create my calendar table but it starts at this fiscal year.  How would I compare YTD performance to the prior year if my calendar table doesn't contain those dates?

1 ACCEPTED SOLUTION

Hi @joeort,

 

CALENDARAUTO() automatically creates a table with one column named "date". The range of dates is calculated automatically based on data in the model. For having years included in your date-table, which are not part of your data model you cannot use CALCULATEAUTO(). Try something like the following:

 

YourCalendarTable =
CALENDAR (
DATE ( YEAR ( MIN ( YourTable[DateColumn] ) -1 ); 1; 1 );
DATE ( YEAR ( MAX ( YourTable[DateColumn] ) ); 12; 31 )
)

 

Regards,

Lars

View solution in original post

1 REPLY 1

Hi @joeort,

 

CALENDARAUTO() automatically creates a table with one column named "date". The range of dates is calculated automatically based on data in the model. For having years included in your date-table, which are not part of your data model you cannot use CALCULATEAUTO(). Try something like the following:

 

YourCalendarTable =
CALENDAR (
DATE ( YEAR ( MIN ( YourTable[DateColumn] ) -1 ); 1; 1 );
DATE ( YEAR ( MAX ( YourTable[DateColumn] ) ); 12; 31 )
)

 

Regards,

Lars

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.