Forum Discussion

lotus22's avatar
lotus22
Icon for Helper III rankHelper III
6 years ago
Solved

Relate the subsequent rows to previous row

Sample Data Above. 

I have customer orders, and in subsequent rows, there will be supplier orders. There could be 10-15 rows for supplier orders after each customer order. I need to calculate whether I am ordering enough material from suppliers against customer orders.

 

Therefore, it is crucial in the last column for each supplier; I am calculating percentage based on respective customer demand.

Using (Supplier Release -Customer Order)/Customer Order

 

For example,

Supplier Part A, B in green will be calculated against Part A

Supplier Part C, D, I in blue will be calculated against Part B

Supplier Part F,E,C in orange will be calculated against Part C

 

Any help is appreciated

6 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    lotus22 - Sample data as text would help. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

    The most important parts are:
    1. Sample data as text, use the table tool in the editing bar
    2. Expected output from sample data

    3. Explanation in words of how to get from 1. to 2.

     

    That said, you likely want to use something like EARLIER. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586.

    • lotus22's avatar
      lotus22
      Icon for Helper III rankHelper III

      Thanks Greg, here is the sample data, hope it load now.

      CustomerPartSupplierPartTypeW1W2W3W4W5W6W7W8W9W10TotalsCalculations
      Part A Customer Order56767787877677889999666677776373 
      Part ASupplier Part ASupplier Release6666766780778807788866688005470-14%
      Part ASupplier Part BSupplier Release677777867888998978889899899599110%
      Part B Customer Order778889997778999999777897778819690 
      Part BSupplier Part CSupplier Release8089989786000200010008000800899199441%
      Part BSupplier Part DSupplier Release03109401250143014901170225001030987050%
      Part BSupplier Part ISupplier Release000560780589040000100242%
      Part C Customer Order3515131116966993 
      Part CSupplier Part FSupplier Release56725889999952%
      Part CSupplier Part ESupplier Release56202533912991019%
      Part CSupplier Part CSupplier Release888883888875-19%
      • lotus22's avatar
        lotus22
        Icon for Helper III rankHelper III

        The expected output is to calculate the percent of supplier release order with the respective customer demand