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!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!