Forum Discussion

MichaelMckinley's avatar
MichaelMckinley
Regular Visitor
3 years ago
Solved

Weighted Average for Multiple Categories

Hey everyone, I've been trying to tackle this all morning and cannot seem to find a solution. What I'm looking to do is get a weighted average across multiple categories as the title says. ...
  • MichaelMckinley's avatar
    3 years ago

    I figured it out!
    I was unaware you could reference the same row being evaluated using the EARLIER operator, so I ended up with a function to get the weight that looks like this:

    Weight = DIVIDE( 'Job Analysis'[Remaining Hours], SUMX(FILTER('Job Analysis', 'Job Analysis'[Planner] = EARLIER('Job Analysis'[Planner]) && 'Job Analysis'[Start Monday] = EARLIER('Job Analysis'[Start Monday])), 'Job Analysis'[Remaining Hours]))

    Then from there I simply multiply each row's slack by its weight.

    Thanks to those of you who took the time to read my post, hopefully this solution might help others.