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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
overmeer
New Member

Filter on multiple dates

Hi all,

 

I want to count the number of subscriptions (=Y)in at a given point (19/08/2021) in time while only taking into account the courses started between 01/07/2021 and 31/12/2021. Then I want to compare this with the number of subscriptions in given point in time Y-1 (19/08/2020) while taking into account the courses started between 01/07/2020 and 31/12/2021.

 

--> I have 2 date tables to filter: dim SubscriptionDate and dim StartDateCourse

--> I have 1 fact table: fact Subscriptions (with the SubscriptionDate and StartDateCourse as variables)

--> I have a filter in my dashboard with SubscriptionDate<19/08/2021

--> I have a filter in my dashboard with StartDateCourse: 2021, Semester 2

 

Based on these filters i want to obtain the following tablestructure: Semester, Y, Y-1

 

Below the Y, but I have no idea how to make the Y-1 in a way that I go one year back for both the SubscriptionDate and StartDateCourse.

 

Anyone who can help me?

 

 

 Y =
VAR maxSubscriptionDate= max('dim SubscriptionDate'[DateSubscription])
RETURN
CALCULATE(DISTINCTCOUNT('fact Subscriptions'[SubsriptionID]),FILTER('fact Subscriptions','fact Subscriptions'[DateSubscription]<maxSubscriptionDate))
1 REPLY 1
lbendlin
Super User
Super User

SAMEPERIODLASTYEAR()

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.