Forum Discussion

DuaneDLB's avatar
DuaneDLB
Icon for Advocate II rankAdvocate II
4 years ago
Solved

Add value from one table Power BI table to another based on two column conditions

I have two tables '1' and '2' (see diagram below). Table1 contains a list of detail orders with a Source and Price.  I would like to add a new column to Table1 called 'Value'.  The value will be pop...
  • v-kkf-msft's avatar
    4 years ago

    Hi DuaneDLB ,

     

    Please create the new column.

     

    Value = 
    CALCULATE (
        SUM ( Table2[Value] ),
        FILTER (
            Table2,
            Table2[Source] = EARLIER ( Table1[Source] )
                && Table2[Beg Price] <= EARLIER ( Table1[Price] )
                && Table2[End Price] >= EARLIER ( Table1[Price] )
        )
    )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.