'SUM VALUES FROM 2 DISTINCT COLUMNS

enter image description here

Hello, people.

As you guys can see on the table above, I´have more than one "seller" per "order_num" and it’s ok. But I need to SUM the "sku_qtd" without repeating the items from the order. Right now, SUM is returning 6 instead of 3.

Pls help me, I have been looking for an answer for hours.



Solution 1:[1]

If you cannot modify the data model to properly represent the relationship between order_num and seller (many-to-one or many-to-many), this DAX formula should do it:

sum_qtd = SUMX(DISTINCT('table'[order_num]),FIRSTNONBLANK('table'[sku_qtd],0))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Strictly Funk