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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Filter for a specific date (-30 days<specific date<90 days)

Hi community,

 

I have had a little difficulty in creating a filter that I can apply to the entire page to see only the information 30 days before and 90 days after the launch date of each product.

 

I have a database in which I can see the daily shipments of each product and another table that contains the release date of each product. What I want is to create a formula that calculates the date difference -30 days and +90 days and that only shows me the sum of the shipments of that period depending on when the product was launched.

 

Hope to get an idea 

Thank you in advance

 

 

 

1 REPLY 1
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

I would add new columns to the table where your release dates are stored in Power Query like this:

// openDate - 30 days before:
Date.AddDays([releaseDate], -30)

// closeDate - 90 days after:
Date.AddDays([releaseDate], 90)

 

Then in your DAX measures you can use these dates to dynamically select this window when selecting different products in the report, something like this:

_windowSales =
CALCULATE(
  SUM(factTable[Sales]),
  factTable[salesDate] >= productTable[openDate],
  factTable[salesDate] <= productTable[closeDate]
)

 

There's some considerations around relationships that I can't address without seeing your model (I've assumed you have a relationship between productTable and factTable based on [Product]), but the principle I've outlined is how I would go about it.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.