Forum Discussion

lpalacios's avatar
lpalacios
Frequent Visitor
8 years ago
Solved

Difference Between two selected year

Hello Everbody:   I hope you are well.    I have some experience in PowerBi ( not that advance) and I don´t figure out how to solve this issue.     I have a table of Purchase by year and organ...
  • Anonymous's avatar
    Anonymous
    8 years ago

    Hi,

     

    Firstly unpivod your puchase data for multiple year column into single column, lik

     Unpivot your data in edit query

    Then create Three different columns as

    Oldest Year Purchase = CALCULATE(sum(Sheet1[Purchase]), Filter(Sheet1,Sheet1[Years]=Min(Sheet1[Years])))

    Newest Year Purchase = CALCULATE(sum(Sheet1[Purchase]), Filter(Sheet1,Sheet1[Years]=Max(Sheet1[Years])))

    Purchase Difference = [Newest Year Purchase]-[Oldest Year Purchase]

     

    Then apply a slicer to select two table. The Purchase Difference field will always provide you the difference of two selected years.

    Use slicer to select two years

    Please let me know if you face any challange.