InventoryValue =
VAR SelectedDate = [SelectedDate]
RETURN
SUMX(
'InventTrans',
IF(
('InventTrans'[StatusIssue] IN {"None", "Sold"} &&
'InventTrans'[StatusReceipt] IN {"None", "Purchased"}) &&
('InventTrans'[DateFinancial] <= SelectedDate &&
'InventTrans'[DateFinancial] <> DATE(1900,1,1) + TIME(12,0,0)),
'InventTrans'[CostAmountPosted] + 'InventTrans'[CostAmountAdjustment],
IF(
('InventTrans'[StatusIssue] IN {"None", "Sold" , "Deducted"} &&
'InventTrans'[StatusReceipt] IN {"None", "Purchased", "Received"}) &&
'InventTrans'[DatePhysical] <= SelectedDate,
'InventTrans'[CostAmountPhysical],
0
)
)
)
CAST(
CASE
WHEN it.DateFinancial <> '1900-01-01 12:00:00 +00:00' AND it.DateFinancial < it.DatePhysical
THEN it.DateFinancial
ELSE it.DatePhysical
END AS datetimeoffset
) AS DateFilter
"If there is a DateFinancial and it's before the DatePhysical, then this will be where my transaction's date becomes valid, else use DatePhysical"Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,902 Super User 2024 Season 2
Martin Dráb 229,336 Most Valuable Professional
nmaenpaa 101,156