Forum Discussion

fyong's avatar
fyong
Frequent Visitor
3 years ago
Solved

How to count balance for replenish ?

 Hi Team , 

 

Can anyone share with me the dax function to get the outcome at "want this outcome" column?

I have created many to many relationship , matrix table .

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi fyong 

    You can refer to the following measure

     

    Balance_ =
    [PO QTY]
        - SUMX (
            FILTER (
                ALLSELECTED ( 'Demand Table' ),
                [Item ]
                    IN VALUES ( 'Demand Table'[Item ] )
                        && [Ordered_Date] <= SELECTEDVALUE ( 'Demand Table'[Ordered_Date] )
            ),
            [Demand QTY]
        )
    

     

     

    Best Regards!

    Yolo Zhu

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

9 Replies