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
kterlikowski
New Member

Filtering a date range with a period slicer and YoY calculation

Hello,

 

I have a date filter and a period filter on a page:

 

kterlikowski_0-1738152528626.png


I would like the period filter to affect the date range but in a way that will allow me to make YoY comparisons. This is how dim_date and the date (period) filter are set up:

kterlikowski_1-1738152606755.png

 

kterlikowski_2-1738152621285.png

kterlikowski_3-1738152656829.png

 


I want to use the period filter as a selector for the date range so that calcualatoins like this one can be done:

Revenue Current Year = CALCULATE(SUM(fact_sales[sales_net]), fact_sales[type]="S")
Revenue Previous Year = CALCULATE([Revenue Current Year], SAMEPERIODLASTYEAR(dim_date[Date]))

Many thanks for help in advance!
1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @kterlikowski 

 

Use REMOVEFILTERS on your filter table similar to my screenshot below.

Revenue Previous Year =
CALCULATE (
    [Revenue Current Year],
    SAMEPERIODLASTYEAR ( dim_date[Date] ),
    REMOVEFILTERS ( 'Date Filter' )
)

danextian_0-1738157135149.png

Please see the attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

1 REPLY 1
danextian
Super User
Super User

Hi @kterlikowski 

 

Use REMOVEFILTERS on your filter table similar to my screenshot below.

Revenue Previous Year =
CALCULATE (
    [Revenue Current Year],
    SAMEPERIODLASTYEAR ( dim_date[Date] ),
    REMOVEFILTERS ( 'Date Filter' )
)

danextian_0-1738157135149.png

Please see the attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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.

Top Solution Authors
Top Kudoed Authors