Forum Discussion
molzmad
5 years agoHelper I
Occupany, Culmulative total help
Hi, i basically have a column labeled occupancy 2, which is a culumaltive total of people entering or exiting a building, im wanting to understand how to modify my DAX so that the occupancy 2 cant go...
molzmad
5 years agoHelper I
Yeah basically, i just want the accumulated column to count but not go below zero :),
Thanks :),
Molly
Anonymous
5 years agoNot applicable
- molzmad5 years agoHelper I
Hi 🙂 column two looks right but i just want it to count accumulatively i.e. column 2 would look like this :
- Anonymous5 years agoNot applicable
Hi molzmad ,
Based on your description, you can create two calculated columns as follows.
Rank = RANKX ( ALL ( 'Enliteon_Office_Test Count_Events' ), [timestamp],, ASC )Test_value = VAR x1 = MAXX ( FILTER ( ALL ( 'Enliteon_Office_Test Count_Events' ), [Rank] <= EARLIER ( 'Enliteon_Office_Test Count_Events'[Rank] ) && [Ins_Outs] < 0 ), [Rank] ) RETURN [Rank] - x1Result:
Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- molzmad5 years agoHelper I
Hi almost, i just want the -1 to minus from the prior number i.e. 3,2,1 rather than the -1 equal zero if that makes sense, but just not allow the column to go below zero, like an accumulative sum that cant go below zero