Forum Discussion
Calculating totals without row context limiting data
- 4 years ago
This might get you a bit closer.
Equipment_Days2 = VAR CurrQty = CalculatedDaysTable[equipment_qty] RETURN CALCULATE ( SUM ( CalculatedDaysTable[DaysValue] ), CalculatedDaysTable[equipment_qty] <= CurrQty, CalculatedDaysTable[equipment_uom] = "Daily" )You used ALL on the entire table, which removes the context from all columns. I'd recommend only using it for specific columns unless you really do want to get rid of all the filtering.
Unfortunately this results in the exact same output as I've been continuously getting, with the additions not being cumulative.
- AlexisOlson4 years ago
Super User
If you're trying to do this as a calculated column, then you have to get the context exactly right. Either remove filters on all the columns you don't want or remove all filters except for a specific set of columns you do want.
I can't tell what all columns you have in your table, so I can't do much more than an educated stab in the dark and you'll have to adjust it to fit your particular table.
- Anonymous4 years agoNot applicable
This formulation did work once it was converted to a measure.
Equipment_Days = VAR CurrQty = max(CalculatedDaysTable[equipment_qty])RETURNCALCULATE (SUM (CalculatedDaysTable[DaysValue]),CalculatedDaysTable[equipment_qty] >= CurrQty &&CalculatedDaysTable[equipment_uom] = "Daily")Thank you for pointing me in the right direction.