Reputation: 49
I'm currently working on inventory reconciliation, and used this measure to calculate the amount of $s(product) we're holding by day:
Inventory = CALCULATE(SUM(ledger[cost]),
FILTER(ALL(DimDate[Date]),
DimDate[Date]<=MAX(DimDate[Date])))
Also, we get charged a fee based upon the amount dollars we're holding by day:
Fee = (0.03/365)*[Inventory]
This how a sample looks like:
I've been trying to create another measure, which is going to be the total sum of the fee but so far I've been successful.(If you can notice the total of "Fee" it isn't the sum of the total fee but the fee evaluated in the last date which is January 9th)
Thank you!
Upvotes: 0
Views: 45
Reputation: 8148
You need to iterate by date and sum up results of each iteration:
Fee = SUMX( VALUES(DimDate[Date]), (0.03/365)*[Inventory])
Upvotes: 1