Forum Discussion

Jacy's avatar
Jacy
Frequent Visitor
8 years ago
Solved

Last year/month value

Hi I have a problem with calculations of different dates, I have a matrix by product, and the month dimension pivoted, in one column I need to add the value of the current year and in another the last year, as the photo in example. I used the following calculation:

calculate (sum (table [value]); filters (table [year] = max (year)))


this works perfectly, but the one from the previous year does not.

calculate (sum (table [value]); filters (table [year] = max (year)) - 1)

af first works but when I select a year, this measurement is left blank because the data has been filtered.

can anybody help me?

 

ps: the picture are in portuguese.

  • calculate (sum (table [value]); filters (ALL(Table[year]), table [year] = selectedvalue(Table[year]) - 1))

2 Replies

  • calculate (sum (table [value]); filters (ALL(Table[year]), table [year] = selectedvalue(Table[year]) - 1))
  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Jacy,

     

    It will be help if you share some sample data for test.

     

    Regards,

    XIaoxin Sheng