cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Dynamic Date Filter: Use Relative Date Filter to drive dates in separate visual?

Hey everyone, 

 

I am currently working on a Weather Data Report. Here is what it contains: 

  1. In my top visual I am grabbing the hourly average temperature over the next 7 days per zip code using a Relative Date Filter.
  2. In the bottom visual, im using a SQL query to grab the daily historical average temperature for each distinct date available.

 

This is where I need you guys. Is it possible to grab the dates that the next 7 days relative date filter is using (top visual) and applying those to the bottom visual minus 1 year? Basically I just want to grab whatever dates are in the top visual, and apply those same dates to the bottom visual but for the previous year.  

 
 

Any ideas? 


weather.PNG

6 REPLIES 6
Highlighted
Solution Sage
Solution Sage

Re: Dynamic Date Filter: Use Relative Date Filter to drive dates in separate visual?

Can you create a new custom column from your Zip Data equal to the Date less 1 year?  Then use that Custom column as part of the SQL query to pull in only the dates you want?

 

FOrrest

Highlighted
Regular Visitor

Re: Dynamic Date Filter: Use Relative Date Filter to drive dates in separate visual?

I'll look into that real quick. Thanks @fhill 

Highlighted
Solution Sage
Solution Sage

Re: Dynamic Date Filter: Use Relative Date Filter to drive dates in separate visual?

Hey @tbuckingham 

 

You can try using a measure with the SAMEPERIODLASTYEAR function in DAX: https://docs.microsoft.com/en-us/dax/sameperiodlastyear-function-dax

 

Let me know if that helps.

Highlighted
Regular Visitor

Re: Dynamic Date Filter: Use Relative Date Filter to drive dates in separate visual?

I can definitely use that if i find a dax formula that can imitate what my relative date filter is doing. So ill need a dax formula to grab the current data and the next 7 days. Once i figure that out i should be able to use SAMEPERIODLASTYEAR

 

Thanks @Tad17 

Highlighted
Solution Sage
Solution Sage

Re: Dynamic Date Filter: Use Relative Date Filter to drive dates in separate visual?

@tbuckingham Is this what you're looking for: https://docs.microsoft.com/en-us/dax/dateadd-function-dax

 

P.S. You can also use TODAY() in DAX.

Regular Visitor

Re: Dynamic Date Filter: Use Relative Date Filter to drive dates in separate visual?

@Tad17  Thank you! This seems to be on the right track. Ill post if its the solution. I appreciate it

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors