Forum Discussion
Anonymous
2 years agoNot applicable
Cumulative Total using measures
I have a dataset that has multiple timestamps for assets. I'm needing to retain the timestamps because I'll have a slider that allows you to adjust all of the visuals based on the timestamp. However,...
Anonymous
2 years agoNot applicable
I'm able to get a working cumulative cost with this measure:
cum_cost = SUMX(TOPN([benefit_rank], CALCULATETABLE(VALUES(table[asset]), ALLSELECTED(table[asset])),[benefit_rank], ASC), [cost_by_asset]).
Then I've added another measure that calculates whether the cumulative cost is greater or equal to the budget parameter (slider).
ind_cost_within_budget = IF([cum_cost] <= [Budget Value], 1, 0)
Now I need to calculate the total benefit for those assets that are within the budget.
This is what I have so far, but it just returns the total benefit, I need it to filter out the assets that aren't within the specified budget.
benefit_within_budget = CALCULATE(SUM(table[benefit]), FILTER(table, [ind_cost_within_budget]=1)).
Maybe I need to take a different approach here? Any thoughts?
Anonymous
2 years agoNot applicable
Hi Anonymous
You want to display the cumulative cost is greater or equal to the budget, you sholuld change the measure:
ind_cost_within_budget = IF([cum_cost] >= [Budget Value], 1, 0)
and can you provide some sample data and the expected output you want?
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.