Forum Discussion

Lily36876's avatar
Lily36876
Helper II
4 years ago
Solved

How to do like SQL JOIN in dax

Hi I have two table data model like pic below, I want to create a column at left table ,count by [ShopNo] and Gds[QtyTot] from right table , meaning for A shop Product A have Owe 3qty for customer ...
  • tamerj1's avatar
    4 years ago

    Hi Lily36876 

    please try

    OweQty =
    SUMX (
        FILTER (
            'Owe Orders',
            'Owe Orders'[ShopNo] = EARLIER ( 'Sho Inventory'[ShopNo] )
                && 'Owe Orders'[GdsNO] = EARLIER ( 'Sho Inventory'[GdsNO] )
        ),
        'Owe Orders'[QtyTot]
    )