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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.