Announcements
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"André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156