Forum Discussion

Amratya's avatar
Amratya
Advocate I
9 years ago
Solved

Plot the difference between two rows in calculated column

I need to know how to get the difference between two rows in DAX   This is my sample data, I need to get difference in net sales between each day in a new column not a mesaure to be able to plot it...
  • Amratya's avatar
    9 years ago

    I reached to get it as a measure through this 

    Change = 
     CALCULATE(
     SUM('TableName'[Net Sales]), 
     FILTER('TableName','TableName'[Date]=MAX('TableName'[Date])
     )
     )- 
     CALCULATE(
     SUM('TableName'[Net Sales]),
     FILTER('TableName','TableName'[Date]=MIN('TableName'[Date])))

    But I still can't plot it to a line chart or a waterfall chart (which is the target actually)