Forum Discussion
PREVIOUSQUARTER returns nothing
Hi misterian
I opened your file and make a quick test, if you create a filled map with calendar date and let's vary the date you will notice that the Response Prev Q Avg works...
The system needs to know what is the previous period so if you choose then the system can generate the previous quarter...
Let us know if it is not working..
I also downloaded the file, and to expand on the previous comment, PREVIOUSQUARTER finds the earliest single date visible in the current filter context, then returns the quarter previous to it. In this case since you don't select a date the earliest visible is the first date in the 'Date' table and therefore can't go back any more. So PREVIOUSQUARTER returns blank, which causes the CALCULATE to return blank.
- misterian8 years agoRegular Visitor
Thanks, that makes sense. So what good is previous quarter? Can I feed a context from as the current date to the previous quarter or just find a different way to do this without previousquarter. Quarters are a little harder than years and months because quarters may "overlap" years.
- mattbrice8 years ago
Solution Sage
I usually prefer to put slicers on the page for Year/Quarter/Month so people can interact with report, but you can do this:
Response Prev Q Avg = var _today = FILTER( VALUES( 'Date'[Date] ), 'Date'[Date] = TODAY() ) RETURN CALCULATE ( AVERAGE(system[ResponseTime]), PREVIOUSQUARTER( _today ) )