Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
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
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
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
98 | |
78 | |
66 | |
53 |
User | Count |
---|---|
139 | |
100 | |
95 | |
85 | |
63 |