Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Create new column from values within table

Hi All,   I would like to create another column that takes the Good Parts value from theLine D10Cell4 and divides it with the quantitiy value from theLine D10Cell1 of that date. That's the method I...
  • v-easonf-msft's avatar
    6 years ago

    Hi , Anonymous 

    Create  a calculated column as below:

     

    1st Column =
    VAR Quantity1 =
        CALCULATE (
            SUM ( 'Table'[quantity] ),
            FILTER (
                'Table',
                'Table'[Day] = EARLIER ( 'Table'[Day] )
                    && 'Table'[theLine] = "D10Cell1"
            )
        )
    VAR GoodParts =
        CALCULATE (
            SUM ( 'Table'[Good Parts] ),
            FILTER (
                'Table',
                'Table'[Day] = EARLIER ( 'Table'[Day] )
                    && 'Table'[theLine] = "D10Cell4"
            )
        )
    RETURN
        DIVIDE ( GoodParts, Quantity1 )

     

     

    Here is  sample :


    URL:

    https://wicren-my.sharepoint.com/:u:/g/personal/michael_wicren_onmicrosoft_com/EY_oFBGTlqZBocDvCYn3eycB4zG_9paEjXWU4ARWcNjGsw?e=xMxkUK 

     

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