Criar cálculo de variação de média entre períodos diferentes

Estou tentando calcular a média dos valores da coluna nota para o período da semana anterior referente a coluna data e calcular a média dos valores da coluna nota para o período da semana atual referente a coluna data
do meu conjunto de dados e assim obter a variação da semana atual versus a semana anterior.

Tentei pela função periodToDateVar e não consegui.

Quem puder me ajudar agradeço.

Hi @lusilva,
you want to calculate the difference or the avg for both weeks?
What about

and/or

BG

Olá! Desejo calcular a média e depois a diferença entre as duas médias (média semana atual - média semana anterior)

Hello @lusilva, I think you will want to use the Lag function in QuickSight. This will allow you to aggregate the average for the week previous and add it to the same row as the average for the current week. Then, you can subtract the 2 values once they exist on the same row.

I will mark this as a solution for now, but if you have any questions or if the function doesn’t work as expected please let me know!