Forum Discussion
Running Total Not Working
- Anonymous6 years ago
Hi Anonymous ,
If i understand you correctly, please modify "ALLEXCEPT(Data_2, Data_2[Group] ,Data_2[ReturnDate])" to "ALLEXCEPT(Data_2, Data_2[Group])".
For Column:
Running_Total_C = CALCULATE ( SUM ( Data_2[P1Log_Ret] ), FILTER ( ALLEXCEPT ( Data_2, Data_2[Group] ), Data_2[ReturnDate] <= EARLIER ( Data_2[ReturnDate] ) ) )For Measure:
Running_Total_M = CALCULATE ( SUM ( Data_2[P1Log_Ret] ), FILTER ( ALLEXCEPT ( Data_2, Data_2[Group] ), Data_2[ReturnDate] <= SELECTEDVALUE ( Data_2[ReturnDate] ) ) )Result would be shown as below:
BTW, if you want to calculate Running Total per month, please refer to the formula below.
Running_Total_monthly = CALCULATE ( SUM ( Data_2[P1Log_Ret] ), FILTER ( ALLEXCEPT ( Data_2, Data_2[Group] ), Data_2[ReturnDate] <= EARLIER ( Data_2[ReturnDate] ) && FORMAT ( Data_2[ReturnDate], "YYYYMM" ) = FORMAT ( EARLIER ( Data_2[ReturnDate] ), "YYYYMM" ) ) )Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
If i understand you correctly, please modify "ALLEXCEPT(Data_2, Data_2[Group] ,Data_2[ReturnDate])" to "ALLEXCEPT(Data_2, Data_2[Group])".
For Column:
Running_Total_C =
CALCULATE (
SUM ( Data_2[P1Log_Ret] ),
FILTER (
ALLEXCEPT ( Data_2, Data_2[Group] ),
Data_2[ReturnDate] <= EARLIER ( Data_2[ReturnDate] )
)
)For Measure:
Running_Total_M =
CALCULATE (
SUM ( Data_2[P1Log_Ret] ),
FILTER (
ALLEXCEPT ( Data_2, Data_2[Group] ),
Data_2[ReturnDate] <= SELECTEDVALUE ( Data_2[ReturnDate] )
)
)Result would be shown as below:
BTW, if you want to calculate Running Total per month, please refer to the formula below.
Running_Total_monthly =
CALCULATE (
SUM ( Data_2[P1Log_Ret] ),
FILTER (
ALLEXCEPT ( Data_2, Data_2[Group] ),
Data_2[ReturnDate] <= EARLIER ( Data_2[ReturnDate] )
&& FORMAT ( Data_2[ReturnDate], "YYYYMM" )
= FORMAT ( EARLIER ( Data_2[ReturnDate] ), "YYYYMM" )
)
)
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.