Forum Discussion

Justair07's avatar
Justair07
Resolver I
6 years ago

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.

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

 

Thank you,

 

-Justair07

6 Replies

    • Justair07's avatar
      Justair07
      Resolver I

      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