Forum Discussion

buttercream's avatar
buttercream
Helper II
7 months ago
Solved

Weighted Average Measure

How do I create a measure that will calculate the weight of an amount relative to a category or multiple categories?  Example below I'd like a measure to calculate the weight of each payment = p...
  • MFelix's avatar
    7 months ago

    Hi buttercream ,

     

    I assume that you have additional information for this visualization in this case I added an ID column just to get the correct syntax add the following two measures:

    Weighted Payments Total = DIVIDE(SUM('Table'[Payment]), CALCULATE(SUM('Table'[Payment]), REMOVEFILTERS('Table'[Customer],'Table'[ID])))
    
    Weighted Payments by Customer = DIVIDE(SUM('Table'[Payment]), CALCULATE(SUM('Table'[Payment]), REMOVEFILTERS('Table'[ID])))

     

     

     

    Be aware that you may need to change this accordingly to your model and visualization.