Forum Discussion
Running Total after certain Month
- 6 years ago
Hi Anonymous ,
Based on what you have described, you want to calculate the cumulative total after a month. Is a certain month a fixed value? Or a dynamic value? If it's a dynamic value, what's the logic behind it.
If the month is a fixed value,please try to create measure like this.
RunningTotal = IF ( MAX ( 'Table'[date] ) >= DATE ( 2020, 3, 1 ), CALCULATE ( SUM ( 'Table'[sales] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[product] ), 'Table'[date] >= DATE ( 2020, 3, 1 ) && SUMX ( FILTER ( 'Table', EARLIER ( 'Table'[date] ) <= 'Table'[date] ), 'Table'[sales] ) ) ), MAX ( 'Table'[sales] ) )Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Based on what you have described, you want to calculate the cumulative total after a month. Is a certain month a fixed value? Or a dynamic value? If it's a dynamic value, what's the logic behind it.
If the month is a fixed value,please try to create measure like this.
RunningTotal =
IF (
MAX ( 'Table'[date] ) >= DATE ( 2020, 3, 1 ),
CALCULATE (
SUM ( 'Table'[sales] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[product] ),
'Table'[date] >= DATE ( 2020, 3, 1 )
&& SUMX (
FILTER ( 'Table', EARLIER ( 'Table'[date] ) <= 'Table'[date] ),
'Table'[sales]
)
)
),
MAX ( 'Table'[sales] )
)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.