cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jacy Regular Visitor
Regular Visitor

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.

Sem título.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Last year/month value

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





Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

2 REPLIES 2
Highlighted
Super User IV
Super User IV

Re: Last year/month value

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





Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

Community Support Team
Community Support Team

Re: Last year/month value

HI @Jacy,

 

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

 

Regards,

XIaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors