Need help with the DAX coding for a conditional weighted average.
See below example.
There are 4 unique accounts (but 7 line items) in CW24, each with their respective Score. If I do a simple average, it takes all scores for all line items and I get 63.86. What I need is the weighted average so it calculates each score only once for each account and provide the average by the unique number of accounts for the calendar week. The desired outcome is the "Weighted Average Column" which would be 70.39+65.45+99.96+0.00 / 4. Some of my scores are 0.00 so these have to be inclusive to the formula. Can anyone assist?
See below example.
There are 4 unique accounts (but 7 line items) in CW24, each with their respective Score. If I do a simple average, it takes all scores for all line items and I get 63.86. What I need is the weighted average so it calculates each score only once for each account and provide the average by the unique number of accounts for the calendar week. The desired outcome is the "Weighted Average Column" which would be 70.39+65.45+99.96+0.00 / 4. Some of my scores are 0.00 so these have to be inclusive to the formula. Can anyone assist?
Year/CW | Account | Score | Average Score | Weighted Average |
2020-CW24 | ABC | 70.39 | 63.86 | 58.95 |
2020-CW24 | ABC | 70.39 | 63.86 | 58.95 |
2020-CW24 | ABC | 70.39 | 63.86 | 58.95 |
2020-CW24 | ABC | 70.39 | 63.86 | 58.95 |
2020-CW24 | DEF | 65.45 | 63.86 | 58.95 |
2020-CW24 | GHI | 99.96 | 63.86 | 58.95 |
2020-CW24 | JKL | 0.00 | 63.86 | 58.95 |