Forum Discussion
jankooy
5 months agoNew Member
Cumulative total more than current value using current filters
I am working on a survival analysis for a large list of assets. I want to use the current filters to update the analysis. I need to have a cumulative total for the assets that calculates the total ...
- 5 months ago
I am not exactly sure what you ask but I far as I understand this could help:
Cumulative Total = COUNTROWS ( FILTER ( ALLSELECTED ( 'ASSET' ), 'ASSET'[Calc_Age] <= MAX ( 'ASSET'[Calc_Age] ) ) )
johnt75
Super User
5 months agoYou can use
Cumulative Total =
VAR MaxAge =
MAX ( ASSET[Calc_Age] )
VAR Result =
CALCULATE ( COUNTROWS ( ASSET ), ASSET[Calc_Age] <= MaxAge )
RETURN
Result
This will keep any filters already in place but replace the filter on Calc_Age, coming from the visual.
If the calc age happens to be sorted by a different column then you would also need to remove the filters from the sort by column, e.g.
Cumulative Total =
VAR MaxAge =
MAX ( ASSET[Calc_Age] )
VAR Result =
CALCULATE (
COUNTROWS ( ASSET ),
ASSET[Calc_Age] <= MaxAge,
REMOVEFILTERS ( ASSET[Sort by column] )
)
RETURN
Result