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.
I have a date table called 'Calendar' with this shape:
Date | Date Month | Site Uptime |
1/1/2019 | January 2019 | 99% |
3/5/2019 | March 2019 | 100% |
... | ... | ... |
I would like to make a report page with a dropdown selection for the month above and a bar graph with a dynamic x axis that shows all the months up to the month selected in the dropdown with the average site uptime for the date in the y axis.
I attempted to do so by making a new table 'Calendar Month Selection' with the following code, but it didn't work:
Calendar Month Selection =
VAR lDate = MAXX('Calendar', 'Calendar'[Date])
RETURN
CALENDAR(DATE(2017, 1, 1), ldate)
Is this possible? If so, how could I make it work?
Solved! Go to Solution.
You dont have to create a date column again.
You can create a measure up to the selected month. See formula below as an example:
Measure =
CALCULATE (
SUM ( Sheet1[Values] ),
FILTER (
ALL( Sheet1[Month] ),
Sheet1[Month] <= SELECTEDVALUE ( Sheet1[Month] )
)
)
@jsup , if you are trying to control the max date of the calendar using slicer that is not possible. Slicer value can not be used in a new table or column.
Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.
You dont have to create a date column again.
You can create a measure up to the selected month. See formula below as an example:
Measure =
CALCULATE (
SUM ( Sheet1[Values] ),
FILTER (
ALL( Sheet1[Month] ),
Sheet1[Month] <= SELECTEDVALUE ( Sheet1[Month] )
)
)
Thanks for your response!
Unfortunately, this doesn't work. Selecting the month in the dropdown simply filters out the data to the month selected.
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 |
---|---|
107 | |
98 | |
78 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |