TOTALYTD several years extension

Simon A 1 Reputation point
2021-03-31T06:49:54.43+00:00

Hello,

I am looking for to use a function to aggregate a stock value but on a time period that goes on several years. To have the total value for each date I can use TOTALYTD but there is a limitation when I switch years. Is it possible to extend this type of function to evaluate the stock each day (with new entries and new outs) on several years?

For example, for the material 10396025, The stock from december is not displayed as I wish it would.

Thanks for your help

83117-image.png

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,171 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Matt Allington 332 Reputation points MVP
    2021-04-01T21:47:48.423+00:00

    This is a DAX question and this is a Power Query forum. You can write a custom time intelligence function like this

    Total Lifetime ToDate =
    CALCULATE(sum(table[value]),FILTER(ALL(Calendar),Calendar[date] <= max(Calendar[date])))

    1 person found this answer helpful.
    0 comments No comments