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

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.

Reply
jsup
New Member

Date Table Up to Max Selected Date for Dynamic Axis

I have a date table called 'Calendar' with this shape:

 

DateDate MonthSite Uptime
1/1/2019January 201999%
3/5/2019March 2019100%
.........

 

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?

1 ACCEPTED SOLUTION
themistoklis
Community Champion
Community Champion

@jsup 

 

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] )
    )
)

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@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.

themistoklis
Community Champion
Community Champion

@jsup 

 

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.