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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Justair07
Resolver I
Resolver I

Trying to Create a Dynamic Calendar

Hi,

 

I'm trying to use the CALENDAR function to create a dynamic calendar table. Here is my DAX:

TimelineDates = CALENDAR(DATE([SelectedYear],01,01),DATE([SelectedYear],12,31))

[SelectedYear] is a measure I created

SelectedYear = SELECTEDVALUE(TimelineYear[Year])

I have a slicer where I select the year, the slicer field is Timeline[Year]

I know the measure is working because I added the results to a Card and it returns the selected year from the slicer perfectly.

 

However, when I add the measure to the CALENDAR function it isn't working. The Calendar creates a date range with the year being 1900, this leads me to belive that the measure is being seen as a 0 in the CALENDAR function.

 

I also thought maybe I needed to convert the mesaure result to a VALUE so I tried this:

TimelineDates = CALENDAR(DATE(VALUE([SelectedYear]),01,01),DATE(VALUE([SelectedYear]),12,31))

The results are still the same as before, see picture below.Capture.JPG

Is what I'm trying to do possible? If not is there another way?

 

Thank you,

 

-Justair07

6 REPLIES 6
rajulshah
Resident Rockstar
Resident Rockstar

Hello @Justair07,

Please note that SELECTEDVALUE doesn't work for calculated columns and tables.

Hi @rajulshah ,

 

I was afraid of that. Do you know of another way I can achive my overall goal? Another method to create a dynamic calender based on a slicer selection?

 

Thank you

 

-Justair07

@Justair07,

 

Do you want a physical table or table that is to be used in a measure?

Hi @rajulshah,

 

I might not understand the difference between a physical table and a table so forgive me but my initial thought is either should work. I have a calander already created entirley from M in the Power Query Editor. My goal was to have the dynamic calender only show a date range for a single year based on the slicer selection. Hope this answers your question.

 

Thank you,

-Justair07

@Justair07,

 

Yes, I got you. But I don't think so there is any other way for that. 

@rajulshah ,

 

Darn. Well thank you. I'll leave this posted for another day or so as unsolved to see if someone has an idea of how to do this.

 

Thank you for all of your help!

 

-Justair07

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.