Forum Discussion
chotu27
8 years agoPost Patron
% Change calculation
Hi All, I need % Change calculation as mentioned below table
- 8 years ago
Hi chotu27
I'm doing it as a calculated measure this time.
Measure = VAR LastVisit = CALCULATE( MAX('Table2'[Visit Name]), FILTER( ALL('Table2'), 'Table2'[Subject Number] = MAX('Table2'[Subject Number]) && 'Table2'[Visit Name] < MAX('Table2'[Visit Name]) )) VAR Visit1 = CALCULATE( SUM('Table2'[Score]), FILTER( ALL('Table2'), 'Table2'[Subject Number] = MAX('Table2'[Subject Number]) && 'Table2'[Visit Name] = LastVisit ) ) VAR Visit2 = SUM('Table2'[Score]) RETURN DIVIDE( Visit2 - Visit1 , Visit1 )
Phil_Seamark
8 years agoMicrosoft Employee
HI chotu27
When you say it isn't working, do you mean you are expecting a lot more in the final column in your screenshot?
chotu27
8 years agoPost Patron
Phil_Seamark Thank you very much i got it worked finally . Your solution is smart
There is one more similar calculation i need
I wanted to compare values with previous row and flag it such as if current value = previous value then put 1 otherwise put 0
look at screen shot below
if visit 2 score is same as visit 1 score then 1 otherwise 0