Forum Discussion
eric66789
3 years agoNew Member
Running total by previous week
Hello, I tried to solve a running total problem that is driving me mad. A running total is fine; it can even be solved with a quick measure, but this is a little trickier. The needed measure shou...
- 3 years ago
Hi,
I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
KPI measure: = SUM( Data[KPI] )RT measure: = CALCULATE ( SUM ( Data[KPI] ), WINDOW ( 1, ABS, 0, REL, ALL ( KW[KW] ), ORDERBY ( KW[KW], ASC ) ) )KPI prevKW measure: = CALCULATE ( SUM ( Data[KPI] ), OFFSET ( -1, ALL ( KW[KW] ), ORDERBY ( KW[KW], ASC ) ) )RT prevKW measure: = CALCULATE ( SUM ( Data[KPI] ), WINDOW ( 1, ABS, -1, REL, ALL ( KW[KW] ), ORDERBY ( KW[KW], ASC ) ) )
Jihwan_Kim
Super User
3 years agoHi,
I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
KPI measure: =
SUM( Data[KPI] )RT measure: =
CALCULATE (
SUM ( Data[KPI] ),
WINDOW ( 1, ABS, 0, REL, ALL ( KW[KW] ), ORDERBY ( KW[KW], ASC ) )
)
KPI prevKW measure: =
CALCULATE (
SUM ( Data[KPI] ),
OFFSET ( -1, ALL ( KW[KW] ), ORDERBY ( KW[KW], ASC ) )
)
RT prevKW measure: =
CALCULATE (
SUM ( Data[KPI] ),
WINDOW ( 1, ABS, -1, REL, ALL ( KW[KW] ), ORDERBY ( KW[KW], ASC ) )
)