Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Calculate weighed average

I want to make a measure that calculate a weighted average of how many minutes our customers have been actively shopping in our store but I can´t for the life of me figure out how to do this in DAX. ...
  • johnt75's avatar
    3 years ago

    Try

    Avg Minutes =
    VAR CustomerMinutes =
        SUMX (
            'Table',
            ( 'Table'[Minutes in store] - 'Table'[Minutes In Queue] ) * 'Table'[Customers]
        )
    VAR Customers =
        SUM ( 'Table'[Customers] )
    RETURN
        DIVIDE ( CustomerMinutes, Customers )