Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

current vs previous week count

Hi Everyone, 
i have seen that dax doesnt have a previous week function, can someone assist in writing a measure that shows previous week counts to compare to that current week count as shown in the tables below. 

 

The first table is a representation of the actual data and the second table is the desired outcome.

 

If anyone can assist in writing such a measure I would greatly apreciate it,

Thank you 

 

Data table 

 

 

Expected outcome 

  • Var _maxWeekNum = max(weeknum)

     

    return

    Calculate(

        countrows(table),

        filter(

            all(table),

            table[weeknum] = _maxWeekNum - 1

        )

    )

2 Replies