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

Notifications

Announcements

No record found.

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?

(4) ShareShare
ReportReport
Posted on by 10
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,133 Super User 2025 Season 2 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 284 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 178 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 116 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans