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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
vsorensen
Frequent Visitor

Using Slicer and Chart to Show Historical Data

Hi Everyone, 

I have a table of activities that has the total slack for each activity at different dates. I want to display a chart using a measure that plots the total slack by date for all the dates up to the date I select in the slicer. 

 

This is what I want to see: 

vsorensen_0-1679430659375.png

 

This is what I get instead: 

vsorensen_1-1679430774878.png

 

I cannot turn off the interactions between the slicer and the chart because I want the chart to change if I select a different date and I cannot change the slicer options to "between" or "multi-select" because of customer requirements. 

 

This is what my data looks like:

vsorensen_2-1679431357773.png

 

This is the measure I am currently using to display the slack trend:

slack trend = 
CALCULATE(
    MAX(schedule[total_slack]),
    FILTER(
        schedule,
        schedule[statusperiod] = MAX(schedule[statusperiod])
    )
)

 

Thanks in advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@vsorensen , If you are filtering one value and want a trend of more than that , then the slicer needs to be on an independent table 

 

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = _max -5
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

https://youtu.be/UoDPMF0nh3Q

 

 

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@vsorensen , If you are filtering one value and want a trend of more than that , then the slicer needs to be on an independent table 

 

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = _max -5
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

https://youtu.be/UoDPMF0nh3Q

 

 

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

Thank you for pointing me in the right direction. Ultimately I used this post to find a solution: 

Overriding slicers - Phil Seamark on DAX

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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