Forum Discussion
Anonymous
5 years agoNot applicable
Pricing Difference
Hi, How do I go about devising a formula to calculate the difference in specific customer product pricing between 2 periods in DAX? Based on the table below, the pricing impact for Product X ...
ERD
Community Champion
5 years agoHi Anonymous ,
I'm not aware of the resulting visual you needm but you can try this measure:
Impact =
VAR _t =
ADDCOLUMNS (
SUMMARIZE ( T, T[Product], T[Customer], T[Period] ),
"@impact",
VAR c_price = CALCULATE ( MAX ( T[Price] ) )
VAR p_price =
CALCULATE (
MAX ( T[Price] ),
FILTER ( ALL ( T[Period] ), T[Period] < MAX ( T[Period] ) )
)
RETURN
CALCULATE ( ( c_price - p_price ) * MAX ( T[Volume] ) )
)
RETURN
SUMX(_t, [@impact])If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.