Forum Discussion

SteveMc's avatar
SteveMc
Frequent Visitor
6 years ago

Creating a weighted average across 3 factors

I have a problem that I can't seem to resolve easily in PBI. I can get it to work in excel with a series of steps but need a solution for a set of customers, that is filterable from my dimension tables.

 

I need to create a weighted average for a client out of a group of clients, 8 in total. Based on a combination of 3 factors; Driver Age, Vehicle Age, Region. In excel I would work out the distribution of count of claims across a concatenation of these factors as a percentage, example below. Then average the each distinct group.

 

Key: UK Region, Driver Age, Vehicle Age12345678Member Average
Scotland, < 25, 01%3%1%8%4%10%4%5%5%
Scotland, < 25, 12%6%2%5%5%2%7%5%4%
Scotland, < 25, 22%1%5%4%3%5%24%8%7%
Scotland, < 25, 32%3%2%5%5%2%4%2%3%
Scotland, < 25, 42%6%2%4%1%5%9%2%4%
Scotland, < 25, 52%11%0%9%2%7%3%2%4%
Scotland, < 25, 63%8%1%2%7%11%7%4%5%
Scotland, < 25, 71%10%8%4%2%6%1%1%4%
Scotland, < 25, 82%6%14%1%3%7%4%3%5%
Scotland, < 25, 90%7%10%6%1%6%1%2%4%
Scotland, < 25, 100%16%11%6%1%5%4%2%6%
Scotland, < 25, 1111%4%4%8%12%5%5%2%6%
Scotland, < 25, 1223%7%6%4%20%10%8%18%12%
Scotland, < 25, 1317%2%22%13%14%7%4%16%12%
Scotland, < 25, 1419%3%4%6%15%5%11%13%10%
Scotland, < 25, 1513%7%8%17%5%6%5%15%10%
Check100%100%100%100%100%100%100%100%100%

 

 

Once I have that I would apply the new average distribution for all clients to the average cost for each group of factors before adding it back up again to give me a new weight adjusted average cost. The question I'm trying to answer is; what would client X look like if they had the same distribution as the entire group of clients?

 

There could be a better way to do this in PBI but still learning the ropes with only forums for help.

 

Thanks in advance.

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi SteveMc ,

     

    There is very little info on how does your calculation work in excel.

     

    Can you share how your table looks like.

     

    Share some sample data and the expected output.

     

    Regards,
    Harsh Nathani
    Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

     

    • SteveMc's avatar
      SteveMc
      Frequent Visitor

      Thanks Harsh

       

      The average costs I mention are below, to match prev sample.

       

      Key: UK Region, Driver Age, Vehicle Age12345678Member Average
      Scotland, < 25, 06,5875,9406,5514,8646,2074,8645,6526,6555,915
      Scotland, < 25, 16,2454,2685,8086,6554,8416,6555,6186,1775,783
      Scotland, < 25, 26,1425,4686,3446,1775,8416,1775,5945,2765,877
      Scotland, < 25, 34,2615,1725,1685,2764,5305,2764,8646,2015,094
      Scotland, < 25, 47,4205,2866,6076,2015,4214,8646,6554,9655,927
      Scotland, < 25, 56,0817,1516,4134,9656,7746,6556,1778,1806,550
      Scotland, < 25, 65,5724,1595,9458,1805,1976,1775,2766,2365,843
      Scotland, < 25, 75,3074,3175,9895,9864,8875,2766,2015,9245,486
      Scotland, < 25, 85,0914,8225,8927,1044,7186,2014,9655,9905,598
      Scotland, < 25, 97,1045,5746,2367,6318,3024,9658,1805,9876,747
      Scotland, < 25, 107,6315,6865,9244,4533,8338,1805,9866,0215,964
      Scotland, < 25, 114,4534,2175,9907,1044,9245,9864,7946,4135,485
      Scotland, < 25, 124,8454,5555,9877,6315,3104,5874,5805,9455,430
      Scotland, < 25, 134,9805,0346,0214,4535,3625,0475,0575,9895,243
      Scotland, < 25, 143,7423,7495,4434,8454,1684,5074,2114,6854,419
      Scotland, < 25, 155,3605,2386,1044,9806,1274,9106,0276,5435,661

       

      Then the result I would expect as a Weight Adjusted Cost, from the the formula =SUMPRODUCT($V8:$V23,X8:X23) this woudl take the member average % distribution ($V8:$V23) against the range of average costs for client 1 only.

       

       12345678
      Weight Adjusted Cost5,4564,9356,0095,9525,3465,4845,4206,000

       

      Hope that makes sense, thanks.

      • SteveMc's avatar
        SteveMc
        Frequent Visitor

        Hi, I still need some help with this as struggling to resolve.