Forum Discussion
Getting previous summed year value
- 4 years ago
Hi, awff ;
Is your problem solved? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
awff , best is to create a separate year table(say Date) and then you can get it easily
example
This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])
- awff4 years agoHelper III
Thanks amitchandak I do have a date table, but for my example table i had left that out.
Whilst it's simple to get previous year value, there are years there the client has bought for a two year term (e.g. 2018 to 2020), so time based dax may not work as 2020 is missing below:
Is there a way to perhaps only look back where current year > previous?
- amitchandak4 years agoSuper User
awff , Then you have to add client , product type and product group too.
It is not the date, it can be yeat table too, as long as you can create it with distinct year
This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Table'),'Table'[Year]=max('Table'[Year]) && 'Table'[clinet]=max('Table'[clinet]) && 'Table'[product type]=max('Table'[product type]) && 'Table'[product group]=max('Table'[product group]) ))