Forum Discussion
smartpug
3 years agoNew Member
Calculating values based on two tables
Hi all, I am a super beginner and have the following case: Problem: We have two tables: Products and Orders. They have a One-To-Many relationship so one Product might be in a few orders - a c...
- 3 years ago
maybe you want a measure, instead of calculated column
NewMeasure=SUMX(Products,COUNTROWS(RELATEDTABLE(orders))*Products[Price])
smartpug
3 years agoNew Member
Yes, this is exactly what I need, thanks! Is it possible to modify this DAX to filter RELATEDTABLE(orders) to include only orders.DeliveryType = "Pickup"?
wdx223_Daniel
3 years agoCommunity Champion
NewMeasure=SUMX(Products,COUNTROWS(FILTER(RELATEDTABLE(orders),orders[DeliveryType]="Pickup"))*Products[Price])