Hi,
I have posted a similar query on Excel Forum :
My question relates to the order you put things in a measure or calculated column where multiplication takes place
so;
t
Which works, but only two of the possible six permutations work, both ending on discount, the other four fail,
the other way is to use a summarized sales table ;
Can someone explain why this happens and what the 'rules' are ?
Richard
I have posted a similar query on Excel Forum :
Excel Formula:
https://www.excelforum.com/office-365/1383891-dax-power-pivot-totals-using-sumx-and-related.html#post5704765
My question relates to the order you put things in a measure or calculated column where multiplication takes place
so;
t
Excel Formula:
ryone :=
SUMX (
Sales,
Sales[Sales]
* ( RELATED ( 'Item'[Price] ) - RELATED ( 'Item'[Cost] ) )
* ( 1 - RELATED ( Customer[Discount] ) )
)
Which works, but only two of the possible six permutations work, both ending on discount, the other four fail,
the other way is to use a summarized sales table ;
Excel Formula:
tryfour :=
SUMX (
SUMMARIZE ( Sales, 'Item'[Cost], 'Item'[Price], Customer[Discount] ),
( 'Item'[Price] - 'Item'[Cost] ) * ( 1 - Customer[Discount] )
* CALCULATE ( SUM ( Sales[Sales] ) )
)
Can someone explain why this happens and what the 'rules' are ?
Richard