Forum Discussion

Karlie69's avatar
Karlie69
Regular Visitor
4 years ago
Solved

Difference between values in the same column for unique index

Hi 🙂 I am having trouble calculating the difference between values in the same column.   My dataset is like this: I added a matrix table based on this data to the dasboard that looks like ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Karlie69 ,

     

    difff = 
    var _pre=CALCULATE(SUM('Table'[Avr]),FILTER('Table',[Part_no]=EARLIER('Table'[Part_no]) && [Year]=EARLIER([Year])-1))
    return  IF(_pre=BLANK(),BLANK(), [Avr]-_pre)

     

     

    If it's not your expected output, please share more detail information to help us clarify your scenario.

     

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.