Forum Discussion
drivas771994
Helper II
8 years agoIs there a formula for calculating the difference between rows.
Hi,
I'm trying to calculate the difference between two values in the same column. For example, I have a student (John Doe) who took one test on 9/1/2018 and received a 76 and then retook the test on 9/5/2018 and got an 88. I want to make a calculated column for the difference in the scores. Is this possible? And would it be specific to each individual student?
Hi drivas771994
I do not see your formula.
Nevertheless I prepared the PowerBI version for you
Please see attached pbix file
7 Replies
- Zubair_Muhammad
Community Champion
Try this pattern
Difference from Previous Score = VAR previousrow = TOPN ( 1, FILTER ( Table1, [Student] = EARLIER ( [Student] ) && [Test Date] < EARLIER ( [Test Date] ) ), [Test Date], DESC ) VAR previousscore = MINX ( previousrow, [Score] ) RETURN IF ( NOT ( ISBLANK ( previousscore ) ), [Score] - previousscore )- drivas771994
Helper II
This looks like it is on excel. Is it?
- Zubair_Muhammad
Community Champion
HI drivas771994
Apologies for late reply.
Yes this is Excel. and this will work in Power BI as well.