Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Jiro
Frequent Visitor

Seek Advice: Inventory Projection

Dear All,

 

I was trying to make inventory projection for the logistics operations, and I am currently struggling with some DAX codes. Appreciate your kind guidance. 

 

*Date format is MM/DD/YYYY

 

1. Inventory Data:

Record is in monthly granularity. The data is providing the latest stock as of the latest refresh time. Currently there is no information for February 2024 Stock. 

 

Stock PeriodInventory On-Floor (MT)
01/01/202430,000

 

2. Outbound Data:

Record is in daily granularity. 

 

Outbound DateNet Quantity (MT)
01/01/2024200
01/02/2024100
01/15/2024500
01/19/2024600
01/27/2024200
01/31/2024100
02/01/2024100
02/04/2024300
02/05/2024700
02/15/2024400

 

Current Measures:

I tried computing below measures, as inventory data is only available in a monthly basis. The granurality is at the first date of January 2024; however, it is giving the latest available as of the latest refresh time. The measure seems fine to me; however, when it comes to the future month projection, for e.g. Feb 2024, you can see that the projection is producing negative values due to no stock data for February yet. 

 

On-Floor MTD := 

Calculate (

           SUMX ( Inventory, Inventory[Qty_Total] ),

           DATESMTD ( 'DATE' [Date] )

            )

 

Outbound MTD := 

Calculate (

           SUMX ( Outbound, Outbound[Net_Qty] ),

           DATESMTD ( 'DATE' [Date] )

            )


Projection := Inventory MTD - Outbound MTD

 

Based on the above measures, the result should look like below which is not favorable due to Feb producing negative value. 

 

Jiro_0-1705316650188.png

 

What I am looking for:

 

Jiro_1-1705317180901.png

 

1. The way to compute DAX that, if Feb 2024 stock data is not available we can take the projection at the end of Jan to be used instead so that we have a look into future inventory where stock data is not yet available (Feb/Mar/Apr) - as long as there are outbound. Any other method is also very much welcome.

2. This aspect aside, is there also any way that we can let the chart shows only data from current date onwards?

 

Thank you in advance!

 

*Edited in laptop for readability 

2 REPLIES 2
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Jiro
Frequent Visitor

Hey @lbendlin,

 

Thanks for the advice as well as response here. I just had time to edit the post. I will try to be more explicit about it. 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.