Quicksight KPI on last month spending vs average three months spending

0

CUDOs billing summary page Hi,

Thank you for making the CUDOs template. I have a question about the KPI table. Is it possible to get the last three months average spend vs last month total spend using the KPI table? For example, in the screenshot took from the public template dashboard, I would like to get (Nov 2022 + Dec 2022 + Jan 2023)/3 vs Feb 2023, which would be (1.04M + 0.93763M + 0.75624M)/3 vs 0.6443M

Thank you!

preguntada hace un año259 visualizaciones
1 Respuesta
0

My attempt:

  1. monthTruncDate: truncdate("MM",{billing_period})
  2. LastMonthSpending: ifelse(dateDiff(monthTruncDate,maxOver(monthTruncDate,[],PRE_AGG), 'MM') = 1, {unblended_cost}, 0)
  3. LastThreeMonthSpendingAverage: ifelse( dateDiff(monthTruncDate, maxOver(monthTruncDate,[],PRE_AGG), 'MM') = 2, {unblended_cost}, dateDiff(monthTruncDate, maxOver(monthTruncDate,[],PRE_AGG), 'MM') = 3, {unblended_cost}, dateDiff(monthTruncDate, maxOver(monthTruncDate,[],PRE_AGG), 'MM') = 4, {unblended_cost}, 0)/3

I checked against the cost explorer and I think LastMonthSpending value is correct but LastThreeMonthSpendingAverage is slightly off by about 0.7 dollar. Can someone help me check if my approach is correct and scalable? Thank you.

respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas