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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Jiro
Frequent Visitor

[Need help] Inventory Projection

Currently I am currently struggling with some DAX codes, and really have no idea where I should go. Appreciate any kind guidance – maybe some rough idea/functions/step- so I can try to code some solutions.

 

*Date format is MM/DD/YYYY

 

Let’s consider the data I have on hands.

 

  1. Inventory Data:

Record is in monthly granularity. The dating of stock period is showing fixed Feb 1st, but it is providing the data as of current date Feb 21st, which is the latest refresh. The dating just remains unchanged. Currently there is no information for March 2024 Inventory. 

 

Stock Period

Inventory On-Floor (MT)

02/01/2024

30,000

 

  1. Outbound Data:

Record is in daily granularity. 

 

Outbound Date

Net Quantity (MT)

02/01/2024

200

02/02/2024

100

02/15/2024

500

02/19/2024

600

02/27/2024

200

02/31/2024

100

03/01/2024

100

03/04/2024

300

03/05/2024

700

03/15/2024

400

 

Current Measures:

I tried computing below measures, as inventory data is only available as a single row, dating Feb 1st, 2024. The measure seems fine to me if the projection is within current month; however, when it comes to the future month projection, for e.g., Mar 2024, you can see that the projection is producing negative values due to no stock data yet. 

 

 

Inventory Projection :=

VAR On-Floor Stock MTD = 
Calculate (
           SUMX ( Inventory, Inventory[Qty_Total] ),
           DATESMTD ( 'DATE' [Date] )
            )

VAR Outbound MTD = 
Calculate (
           SUMX ( Outbound, Outbound[Net_Qty] ),
           DATESMTD ( 'DATE' [Date] )
            )

VAR Result =
Inventory MTD - Outbound MTD

RETURN
            Result

 

 

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

 

Jiro_2-1708498623815.png

 

 

What I am looking for:

 

Jiro_1-1708498463084.png

 

The way to compute DAX: If Mar 2024 stock data is not available, is there any chance we can use the projection at the end of Feb to compute projection for Mar 2024? As we are aiming to look into Mar and so on. Any other solution is also very much welcome.

2 REPLIES 2
some_bih
Community Champion
Community Champion

Hi @Jiro it seems you need something like column ShowValueForDates in your date / calendar table.

Check link for details





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Jiro
Frequent Visitor

Thanks @some_bih. I already have the date calendar and linked it with the inventory data. 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.