Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Calculate Projected Inventory for next 12 months

Hi All,

 

I am new in the power bi world and hoping someone can help me. 

I've been trying to calculate a Projected Inventory for next 12 months for the last 2 weeks without any luck :smileysad:

Data is based on input from the MRP (D365 - Supply Schedule). I am trying to replicate the same concept in D365 – Supply Schedule where users can view at high level and detail level.

 

Key Points;

1. Previous date (01/01/1900) will be used to determine yesterday opening, net and closing qty

2. Opening Qty = sum(On hand)

3. Net Qty =Qty Receipt + Qty Issue 

4. Closing Qty = Opening Qty + Net Qty. This will be opening qty for next month regardless if there is transaction on that particular month. 

5. If there is no net qty for particular month, opening and closing will be the same as per closing value of last month.

6. Need to calculate extended cost for point 2,3,4.

7. I only provided a sample of data. I am handling more than 250K to 500K data

 

DAX Calculation

      Cal Opening Qty = sum(Requirement[On Hand]) +
                                      CALCULATE(sum(Requirement[On Hand]) + sum(Requirement[Net Qty]),
                                             FILTER(ALLEXCEPT(Requirement,Requirement[ItemIDKey],Requirement[dataAreaId] ),
                                             Requirement[Month] < MAX(Requirement[Month])))
      Net Qty = sum(Requirement[net qty)
 Cal Closing Qty = sum(Requirement[On Hand]) +
                                      CALCULATE(sum(Requirement[On Hand]) + sum(Requirement[Net Qty]),
                                             FILTER(ALLEXCEPT(Requirement,Requirement[ItemIDKey],Requirement[dataAreaId] ),
                                             Requirement[Month] < MAX(Requirement[Month])))

      Extended Cost calculates by multyply above with cost

Outcomes;

Issues;

1. The opening qty does not carry over to next month due to no transactions (highlighted in yellow)

    If there is no net qty, the opening and closing qty should be the same as per closing value of last month.

2. Opening, net and Closing value are calculated in-correctly (wrong). The calculation for Qty seems OK

3. Total value is incorrect.

 

The value should be

I wanted to create a summary table by

1. AU/NZ

2. Vendor

3. Item level

 

Can someone please help me especially in DAX formula?

 

Cheers

SF

7 Replies

  • v-lili6-msft's avatar
    v-lili6-msft
    Community Support

    hi, Anonymous 

    It seems that the link doesn't work, please check it

    That didn't work

    We're sorry, but you can't be found in the nhp365-my.sharepoint.com directory. Please try again later, while we try to automatically fix this for you.

     

    Best Regards,

    Lin

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Lin (@lin),

       

      It seems OK for me to downloadload the pbix but saying that i might have access to my one drive. I believe i need to give permission to my folder or do you have alternative that i could send the file?

       

      Cheers

       

      SF