Forum Discussion

djoellet's avatar
djoellet
Frequent Visitor
3 years ago
Solved

Weighted Average Measures Help

Please see the sample data below.  I have the first three columns in my source data but I need help with the weighted columns.  I am trying to create three measures.  One that will calculate a Weight...
  • Ashish_Mathur's avatar
    3 years ago

    Hi,

    Write these measures

    Gross margin = sum(Data[GM[)

    Revenue = sum(Data[Rev])

    Revenue across all customers = calculate([Revenue],all(Data[Customers]))

    Weight = divide([Revenue],[Revenue across all customers])

    Weighted GM = SUMX(Values(Data[Customers]),[Weight]*[Gross margin])

    Weighted GM % = divide([Weighted GM],[Revenue])

    Hope this helps.