cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
crisher
Frequent Visitor

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
Frequent Visitor

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())

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.