DAX Language: How to substract cells from two rows in a column

Substracting the raws in DAX is not a straight forward process.

Steps:

  1. First in the Power Query, add the index and Index.1 as a new column.

2. Example for TotalSales

PriceVariation= SALES[SalesAmount]-CALCULATE(SUM(SALES[SalesAmount]),FILTER(SALES,SALES[Index.1]=EARLIER(SALES[Index])))