Forum Discussion

JLambs20's avatar
JLambs20
Icon for Helper III rankHelper III
2 years ago
Solved

Difference between one value and average of all values using DAX

Hello, I need help with what seems like a straight-forward problem.  I simply need to divide an individual weight (green highlight) by a group of value's average (yellow).  So in this example, I need the "Change" column to be the difference between the weight of Value 1 and the Average of all of the values.

Thank you!

  • You can create a measure using ALLSELECTED to remove the row level context. Something like this should work:

    Change = DIVIDE( SUM( Weight ) , CALCULATE( AVERAGE( Weight ) , ALLSELECTED( Value ) ) , BLANK() )

2 Replies

  • CoreyP's avatar
    CoreyP
    Icon for Solution Sage rankSolution Sage

    You can create a measure using ALLSELECTED to remove the row level context. Something like this should work:

    Change = DIVIDE( SUM( Weight ) , CALCULATE( AVERAGE( Weight ) , ALLSELECTED( Value ) ) , BLANK() )