Forum Discussion
Button to filter dates based on another field/slicer
I have a series of videos, each with a release date roughly a month apart. I have views for each day going forward from release. I want buttons that will filter the entire page from the release date to three days out, seven days out, and fourteen days out. When someone chooses May Video from the slicer, all of the data on the page should filter to start on the May Video release date, then end either three, seven, or fourteen days out. If they choose the August Video, the filter should start on the August Video release date. Bonus if it automatically filters out weekends (I have an Is Weekday field for this), but I can do that by a separate page filter if necessary.
I can't figure out how to get the relative time period from a moving date. Due to my audience, this must trigger from the Video Title slicer, not from a date range slicer. Select a video -> entire date range shifts. Select a button, that range is filtered relative to the release date of that video. PBI with sample data.
6 Replies
- amitchandak
Super User
Anonymous , expected output is not clear,
refer if these two examples can help?
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
- AnonymousNot applicable
I might be able to make that work (I only see one example, was there supposed to be another?), but I'm not sure. It looks like it is relative based on today's date, which isn't what I want.
Lemme see if I can make this clearer: if someone chooses the May video from the slicer, with a release date of May 1, I should see the views data from each of the next seven days.
Release Date: May 1, 2021Views Data:
May 1, 2021: 100
May 2, 2021: 150May 3, 2021: 130
May 4, 2021: 75
May 5, 2021: 50
May 6, 2021: 45
May 7, 2021: 30
So the BAN at the top would say 580 views and the line chart would have these seven days, etc. If I chose the 3 day button/slicer, the BAN would say 380 views and the line chart would have three days.
If they then choose the August video, with a release date of Aug 1, I should see views data from Aug 1-7.
I could do the 3, 7, and 14 days as a slicer instead of buttons, but I cannot do a straight date range slicer - it must filter based on the video title slicer to get into the right start date for the chosen video.
- AnonymousNot applicable
Maybe I can break this down into parts and see if someone can help with the individual steps.
What's the best way to filter a date slicer based on another slicer (the video subject)? Perhaps if I can start there, then I can move on to figuring out how to set up the dates relative to the video release date.
- v-jingzhang
Community Support
Hi Anonymous
Do we only need to show data about the selected video in this page, right? (You will not select multiple videos in the video slicer?) If so, it is possible to realize. At present I have two ideas: one is to use measures to calculate the views data with date filters in them and use slicer to switch options rather than buttons; the other idea is to use bookmarks. I will update here with a sample maybe tomorrow.
Regards,
Community Support Team _ Jing- AnonymousNot applicable
Yep, correct - one video at a time. Appreciate the help!