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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Employee
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
Employee
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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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