Forum Discussion
aatish178
Helper IV
2 years agosubtracting previous row value from current row dynamically in Table visual
quantumudit Hi Udit,I have a below dataset: FY StudentID StudentName Gender Status ClassDivision FY19 11 palash M Absent DIV A FY19 12 akash M Absent DIV A FY19 13 vi...
- Anonymous2 years ago
Hi aatish178
First, we need to ensure we have a measure that calculates the total count of StudentID for each FY.
Total Students = COUNT('Table'[StudentID])Next, we'll create a measure that calculates the difference in the count of StudentID between each FY and the previous FY.
Difference = VAR CurrentFY = MAX('Table'[FY]) VAR PreviousFY = CurrentFY - 1 VAR CurrentFYCount = CALCULATE([Total Students], 'Table'[FY] = CurrentFY) VAR PreviousFYCount = CALCULATE([Total Students], 'Table'[FY] = PreviousFY) RETURN CurrentFYCount - PreviousFYCount% = VAR CurrentFY = MAX('Table'[FY]) VAR PreviousFY = CurrentFY - 1 VAR CurrentFYCount = CALCULATE([Total Students], 'Table'[FY] = CurrentFY) VAR PreviousFYCount = CALCULATE([Total Students], 'Table'[FY] = PreviousFY) RETURN (CurrentFYCount - PreviousFYCount)/PreviousFYCountThis is the result you want:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
2 years agoHi,
Do you have a proper Date column? If no, then do you have a Year and Month column? Also, from which month does every FY start?