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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Jakob_PBI
Frequent Visitor

Calculating stock level value from last month - new demand

Hi

 

I need help to calculate new stock level.
I have 3 tables:

1) inbound (incoming new products to the warehouse)

2) demand (how much demand in qty is expected)

3) stock level (current stock level for 1 date)

 

i need help to calculate the correct new stock level, which mean i need the "result" from last months new stock level and place it into new stock level static, .. or something.. im not sure but i hope the problem is intuitive, i just need to calculate new stock level by using last months calculation in the next month.

 

Here is PBI file

https://www.dropbox.com/s/4y23cv00z0y8836/samle%20pbi.pbix?dl=0

 

and here is pictures in case you cant downloade the file:

Jakob_PBI_3-1682671429780.png

the green is right, the red is wrong

Jakob_PBI_8-1682671650190.png

 

Jakob_PBI_4-1682671440795.png

Jakob_PBI_5-1682671448814.pngJakob_PBI_6-1682671457601.pngJakob_PBI_7-1682671464226.png

 

 

in case you cant download the file, its very simple, here is the underlying data:

Jakob_PBI_0-1682671375033.png

Jakob_PBI_1-1682671402697.pngJakob_PBI_2-1682671415774.png

 

 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi,

 

According to your statement, I think you want [new stock level] returns 1840 in Feb 2023.

Try measure as below.

new stock level =
IF (
    ISBLANK ( [demand_qty] ),
    BLANK (),
    CALCULATE (
        [inbound_qty] + [stock level static] - [demand_qty],
        FILTER ( ALL ( _dimdate ), _dimdate[Date] <= MAX ( _dimdate[Date] ) )
    )
)

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-rzhou-msft
Community Support
Community Support

Hi,

 

According to your statement, I think you want [new stock level] returns 1840 in Feb 2023.

Try measure as below.

new stock level =
IF (
    ISBLANK ( [demand_qty] ),
    BLANK (),
    CALCULATE (
        [inbound_qty] + [stock level static] - [demand_qty],
        FILTER ( ALL ( _dimdate ), _dimdate[Date] <= MAX ( _dimdate[Date] ) )
    )
)

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.