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
Anonymous
Not applicable

Calculate inventory daily

Hi, anyone could help me with calculate inventory at the end of the day, and then use it for initial inventory the next day

 

This is a monthly report , i have initial inventory as a fixed number, i have all productions and consumptiosn defined. IT's easy in  excel to achieve this, but i'd like to try some What if analysis so i need to model this in PowerBi

All data in green is a information i got as a input, without change during month.  

It's some kind of budget, then i would have to create the actual values and compare them. But i'm having troubles with this,

thank you in advance,

I tried measures and prev day, but doesnt' seem to work the way i want.

 

 

Inventory_DAX.jpg

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

Hi, @Anonymous ;

You could try it.

Final Inventory =
27389
    + CALCULATE (
        SUM ( [Production] ) - SUM ( 'Table'[Consumption 1] )
            - SUM ( 'Table'[Consumption 2] )
            - SUM ( 'Table'[Consumption3] ),
        FILTER ( ALL ( 'Table' ), [Date] <= MAX ( 'Table'[Date] ) )
    )
Initial Inventory = CALCULATE([Final Inventory],FILTER(ALL('Table'),[Date]<MAX('Table'[Date])))

The final output is shown below:

vyalanwumsft_0-1638851093087.png

Best Regards,
Community Support Team_ Yalan Wu
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

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could try it.

Final Inventory =
27389
    + CALCULATE (
        SUM ( [Production] ) - SUM ( 'Table'[Consumption 1] )
            - SUM ( 'Table'[Consumption 2] )
            - SUM ( 'Table'[Consumption3] ),
        FILTER ( ALL ( 'Table' ), [Date] <= MAX ( 'Table'[Date] ) )
    )
Initial Inventory = CALCULATE([Final Inventory],FILTER(ALL('Table'),[Date]<MAX('Table'[Date])))

The final output is shown below:

vyalanwumsft_0-1638851093087.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you so much I really appreciate your time to answer. Best Regards

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please indicate if this needs to be done in DAX or if it can be done in Power Query.

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! Prices go up Feb. 11th.

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.

Jan NL Carousel

Fabric Community Update - January 2025

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