Forum Discussion
chotu27
Post Patron
8 years agoHow do i get previous value with legend on matrix visual
HI,
I need calculation for getting previous record with respect to legend kept in matrix visual
Sample Data is here
see the below image
Explanation : I need previous score calculation based on legend kept
Ex : Such for ID: 1001 Visit2 = 30(Previous Score) based on Judgement, Visit2 = 23(Previous Score) based on Memory
Hi chotu27
Modify formula with the following
previous score = CALCULATE ( MAX ( [Score] ), FILTER ( ALL ( 'previous visits' ), [Item Text] = EARLIER ( [Item Text] ) && [Index] = EARLIER ( [Index] ) - 4 && [Subject number] = EARLIER ( 'previous visits'[Subject number] ) ) )Best Regards
Maggie
3 Replies
- v-juanli-msft
Community Support
Hi chotu27
First create an index column from 1,Next create a calculated columnprevious score = CALCULATE(MAX([Score]),FILTER(ALL('previous visits'),[Item Text]=EARLIER([Item Text])&&[Index]=EARLIER([Index])-4))Best RegardsMaggie- chotu27
Post Patron
v-juanli-msft Hey Thanks it is working well but when i get new ID it is taking previous score from previous id please see the screenshot below
- v-juanli-msft
Community Support
Hi chotu27
Modify formula with the following
previous score = CALCULATE ( MAX ( [Score] ), FILTER ( ALL ( 'previous visits' ), [Item Text] = EARLIER ( [Item Text] ) && [Index] = EARLIER ( [Index] ) - 4 && [Subject number] = EARLIER ( 'previous visits'[Subject number] ) ) )Best Regards
Maggie