Forum Discussion

Mathewtmp's avatar
Mathewtmp
Frequent Visitor
1 year ago
Solved

Help to create a inventory projection report

Hi all, Beginner here and trying to create a inventory projection report. I have read a lot of related posts but have been unsuccessful in replicating the formulas.    My database has a tables fo...
  • Rupak_bi's avatar
    Rupak_bi
    1 year ago

    Hi Mathewtmp ,

    Here is your solution

    Steps to perform

    1. create an Union table as below

    Union table =
    ADDCOLUMNS(
        DISTINCT(
                UNION(
                    SELECTCOLUMNS(Demand,Demand[Date],Demand[Part No]),
                    SELECTCOLUMNS(SIT,SIT[Date],SIT[Part No]),
                    SELECTCOLUMNS(SOH,SOH[Date],SOH[Part No])
                )
        ),
        "Demand",LOOKUPVALUE(Demand[Demand],Demand[Date],Demand[Date],Demand[Part No],Demand[Part No]),
        "SOH",LOOKUPVALUE(SOH[Qty],SOH[Date],Demand[Date],SOH[Part No],Demand[Part No]),
        "SIT",LOOKUPVALUE(SIT[PO Qty],SIT[Date],Demand[Date],SIT[Part No],Demand[Part No])
    )
     
    2. Create a Measure
    Daily Balance =
     sum('Union table'[SOH])+sum('Union table'[SIT])-sum('Union table'[Demand])
    3. Create another measure
    Opening Balance =
    sum('Union table'[SOH])+
    CALCULATE([Daily Balance],ALLEXCEPT('Union table','Union table'[Demand_Part No]),'Union table'[Demand_Date]<max('Union table'[Demand_Date]))
    4. Create another Measure
    Stock Balance =
     CALCULATE([Daily Balance],ALLEXCEPT('Union table','Union table'[Demand_Part No]),'Union table'[Demand_Date]<=max('Union table'[Demand_Date]))
     
    Now take a matrix, columns as below

    Please note, all the columns will come from the new union table. 

    In your sample data, the incoming dates are coinsiding with demand dates. So I used demand date as axis which is simple. If it is not the case in your actual table, you need to use a date master. 

     

     

    thanks

    If this solves your issue, please accept as solution.