Forum Discussion
Slow visual calculation (PREVIOUS and RUNNINGSUM)
- 3 months ago
You need to avoid a RUNNINGSUM as that is an inherently expensive operation. If what you are trying to achieve is to visually highlight when rows belong to the same or different people, I think I would assign each person a colour, so that no matter what the order of the visual is the same person always has the same colour.
I think you could do this by using the RANK method I proposed and applying the MOD logic within the measure, or using some other way to turn a unique Person Key into a unique colour.
Your running sum is effectively just returning a ranking, so you could try creating a measure which returns the ranking instead. Assuming that Person Key is unique, you could create a measure like
Person Key Rank =
RANK ( ALLSELECTED ( 'Person'[Person Key] ) )
You can then either add that to the visual and create a visual calc to perform your MOD arithmetic, or amend the measure to include the MOD in there as well.
While that would work with the default sort, I'm trying to make it also work if it's sorted.
With another sort, sometimes the rank+mod will coincide on the same value.
I'm not expecting it to always be useful in this situation, but at least avoid being misleading.
- johnt753 months agoSuper User
You need to avoid a RUNNINGSUM as that is an inherently expensive operation. If what you are trying to achieve is to visually highlight when rows belong to the same or different people, I think I would assign each person a colour, so that no matter what the order of the visual is the same person always has the same colour.
I think you could do this by using the RANK method I proposed and applying the MOD logic within the measure, or using some other way to turn a unique Person Key into a unique colour.