cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
crisher
Helper I
Helper I

Setting Date Context in CALCULATE for PREVIOUSQUARTER

Hello, I need to set a date context of TODAY() within a CALCULATE function to properly have the PREVIOUSQUARTER evaluate what the previous quarter should be instead of taking the very first date of the Date Table.

 

 

Registrations Prev Qtr = CALCULATE(COUNT(Registration[Id]), PREVIOUSQUARTER(DimDate[Date]))

 

That is the DAX calculation right now. Then, I can apply a filter with the filter pane to set the "Date" to today for that specific visual. However, this breaks down when I need to use the measure above to create another measure to calculate a ratio with DIVIDE. 

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

does this work?

Registrations Prev Qtr = CALCULATE(CALCULATE(COUNT(Registration[Id]), PREVIOUSQUARTER(DimDate[Date])),DimDate[Date]=TODAY())

View solution in original post

2 REPLIES 2
crisher
Helper I
Helper I

It did indeed. Thank you!

wdx223_Daniel
Super User
Super User

does this work?

Registrations Prev Qtr = CALCULATE(CALCULATE(COUNT(Registration[Id]), PREVIOUSQUARTER(DimDate[Date])),DimDate[Date]=TODAY())

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors