web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Unanswered

Inventory Value Storage Report - How to replicate logic in PowerBI?

(5) ShareShare
ReportReport
Posted on by 12
Hello there. I need to replicate the inventory value report in a PowerBI dashboard. I was able to replicate the inventory value for each item and total value only on the current date. If I run the report on today's date, it matches perfectly with my PowerBI.
However, if I filter back in time, there is a mismatch between what I calculate and what the report shows. I assume there is a logic I am missing, can anyone please advice?

This is my PowerBI measure to calculate the InventoryValue based on the InventTrans data.
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
        )
    )
)
The logic is the following:
"For each row, sum the CostAmountPosted + CostAmountAdjustment if there is a DateFinancial and its before the currently selected date and the transaction's status is Sold or Purchased.
Else, if the DatePhysical is before the SelectedDate and matches as Sold/Deducted and Purchased/Received, then use just CostAmountPhysical"


I have created a filtering DateFilter column with the following logic:
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"

With this, DateFilter is used to filter down the transactions rows which were available on a certain SelectedDate.

I think there is an addittional logic on when to sum the AdjustmentCost probably. Thanks in advance for your help! :D
 
I have the same question (0)
  • Vahid Ghafarpour Profile Picture
    12,278 on at
    Ensure that the timing of the adjustment costs is correctly accounted for. In Dynamics 365, adjustments might be applied retroactively, affecting the inventory value on previous dates. You might need to include logic to handle these retroactive adjustments.
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 99 Super User 2026 Season 2

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 75 Super User 2026 Season 2

#3
Paolo Cecchelli Profile Picture

Paolo Cecchelli 54 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans