Forum Discussion

poweruser124's avatar
poweruser124
New Member
3 years ago
Solved

Weighted Average by Distinct Category

Hello PBI Community,   I'm fairly new to DAX and am trying to write a DAX formula to calculated weighted average by distinct category as follows:   The table structure is this: Row ID (Key)__...
  • amitchandak's avatar
    3 years ago

    poweruser124 , Try a measure like

     

    Var _tab= Summarize(Table,[Total Sample],Table[Average Size within Sample])
    return
    divide(Sumx(_tab, [Total Sample] * Table[Average Size within Sample]), Sumx(_tab, [Total Sample]))