question

SimonA-3528 avatar image
0 Votes"
SimonA-3528 asked MattAllington-5456 answered

TOTALYTD several years extension

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


power-query-not-supported
image.png (3.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MattAllington-5456 avatar image
0 Votes"
MattAllington-5456 answered

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])))

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.