Forum Discussion
Anonymous
6 years agoNot applicable
DAX WHERE clause equivalent multiple tables
Hi, tables are joined on partNumber. I am trying to figure out how to get hostHardware = (confighHost[Qty] * partsCost[Cost]) WHERE partsInterval[Interval] = "FIXED" && partsSuperCategory[superCate...
Anonymous
6 years agoNot applicable
As a side note, while I was waiting on some help, I started looking at IF vs FILTER, and this also works:
hostHardware =
sumx(configHost,
IF(
(RELATED(partsSuperCategory[superCategory]) = "BASESYSTEM" && RELATED(partsInterval[Interval]) = "FIXED"),
RELATED(partsCost[Cost]),0
) * configHost[Qty]
)
TomMartens
Super User
6 years agoHey Anonymous ,
I guess the IF solution might not be as efficient as the CALCULATETABLE solution as the condition will be checked on a row-by-row basis (the remaining rows of the table used as an iterator), whereas CALCULATETABLE leverages filter propagation.
Regards,
Tom