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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

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 6
Anonymous
Not 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.

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

Anonymous
Not applicable

Yep, correct - one video at a time. Appreciate the help!

Hi @Anonymous 

 

I remove the relationship between two tables, add another table for date range slicer and create several measures. I use a slicer to replace the buttons. In format pane > General > Orientation, select Horizontal rather than Vertical for the slicer. The options appear like buttons. 

21090301.jpg

 

I didn't consider Weekday in this sample. When you mentioned Weekday in the original post, do you want to show the next 3/7/14 workdays in the page? If so, I need to modify the report.

 

Let me know if you have any questions.

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

amitchandak
Super User
Super User

@Anonymous , expected output is not clear,

 

refer if these two examples can help?

https://community.powerbi.com/t5/Desktop/Required-custom-date-Slicer-Last-7-days-last-15-days-last-30/m-p/1284966#M561629

 

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

Anonymous
Not 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, 2021

Views Data:

May 1, 2021: 100
May 2, 2021: 150

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.