Forum Discussion

Jorjor's avatar
Jorjor
Frequent Visitor
2 years ago
Solved

Calculate QTY for a two part IF function

I want to calculate the QTY for each component in my data set. The forumula I'm using is only calculating for the top item not all of them.   BOM Q = SUMX(FILTER('All Demand',[BOM ID]=EARLIER('WOR...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Jorjor ,

     

    You can try formula like below to calculate QTY = Remanin finish * BOM QTY:

    QTY 1 =
    VAR CurrentBOMID = 'RemainingFinishTable'[BOM ID]
    VAR CurrentComponent = 'RemainingFinishTable'[Component]
    VAR BOMQTY =
        CALCULATE (
            SUM ( 'BOMTable'[BOM QTY] ),
            FILTER (
                'BOMTable',
                'BOMTable'[BOM ID] = CurrentBOMID
                    && 'BOMTable'[Component] = CurrentComponent
            )
        )
    RETURN
        BOMQTY * 'RemainingFinishTable'[Remain Finish]
    

    Best Regards,
    Adamk Kong

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.