Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculating average values based on filter

I want to calculate one total weighted average based on all entries in a table that responds to user selected filters on the table. In these tables the quantity is the weight and hardiness is the ba...
  • johncolley's avatar
    4 years ago

    Hi Anonymous ,

     

    Assuming I have your logic right - I think the answer you are expecting is 4.107 when nothing is selected? If so the following should work.

    Weighted Avg = 
    Var Plantvalue = SUMX(Plants, Plants[Quantity]*Plants[Hardiness ])
    Var Quantity = SUM(Plants[Quantity])
    Var result = Plantvalue / Quantity
    Return
    result