Forum Discussion
csanromano
10 years agoRegular Visitor
Calculate difference between two rows
Hi. I am a beginner in Power BI; I do not know if this is the right forum. I have the following table: Year / Week / Value 2015 / 27 / 1000 2015 / 28 / 1010 2016 / 27 / 1200 2016 / 28 / 1205 I...
Anonymous
7 years agoNot applicable
Hi, I just worked on your problem.. If this is column of two years then the below calculation will work:
DIVIDE(CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Year]=MAX('Table1'[Year]))),(CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Year]=MAX('Table1'[Year])-1))))
I build this formula in two sections
Numerator:
CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Year]=MAX('Table1'[Year])))
Denominator:
CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Year]=MAX('Table1'[Year])-1))
then did the divide.
Below are the results:: Let me know if it works for you :)