I've got two tables.
The 1st one contains SKU, client, order date, order amount.
The 2nd one contains SKU, client, promo id, promo start date, promo end date.
I need to calculate ordered amount for each client-promo-SKU.
In Excel I would have something like:
SUMIFS(
TABLE1[ORDERED],
TABLE1[CLIENT], TABLE2[CLIENT],
TABLE1[ORDER DATE], ">="&TABLE2[ORDER START DATE],
TABLE1[ORDER DATE], "<="&TABLE2[ORDER END DATE],
TABLE1[SKU], TABLE2[SKU]
)
Excel formula. Cells K2 and K3
I've already figured out how to filter the first table by date (the connection between ORDERS and PromoLib tables is SKU, many to many):
ordered = CALCULATE(
SUM(ORDERS[order qty]),
KEEPFILTERS(DATESBETWEEN(ORDERS[Document Date], PromoLib[Order Start],
PromoLib[Order End])),
)
How can I add filters to this DAX formula so it will filter the ORDERS table by client?