Forum Discussion

crisher's avatar
crisher
Helper I
5 years ago
Solved

Count Rows for Previous Quarter

Hello, I have tried multiple ways to calculate the number of records in this table from the previous quarter:   Registrations Prev Qtr = CALCULATE(COUNTROWS(Registration), PREVIOUSQUARTER(Registra...
  • PaulOlding's avatar
    5 years ago

    I think it's because the PREVIOUSQUARTER function doesn't mean previous to today's date, it's the previous quarter to the earliest date in the current filter context.

    You have the measure in a card, with no filter on date applied.  So, PREVIOUSQUARTER is going to be returning the dates in the quarter before the earliest date in your DimDate table.  Hopefully that's a period where there's no data in your fact table (otherwise you've got an issue with your date table) and is why the measure returns blank.

     

    What happens if you apply a filter to the card visual only, setting DimDate[Date] to today's date?