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
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!