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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors