Forum Discussion

monkeynuts100's avatar
monkeynuts100
Regular Visitor
9 years ago
Solved

SUM values only for distinct values in another column

I have data like this:   Unique ID Version 1234 1 1234 1 1234 2 1234 2 1234 3 1111 2 1111 2 2223 3 3556 2 3556 2 4432 1 I need to culculate the...
  • monkeynuts100's avatar
    monkeynuts100
    9 years ago

    Thanks everyone for your helpful suggestions. In the end, I did some work in my SP to add a new column for my average calc like this:

     

    Unique IDVersionAve Calc
    123411
    12341NULL
    12341NULL
    12341NULL
    123422
    12342NULL
    123433
    111122
    11112NULL
    222333
    355622
    35562NULL
    35562NULL
    443211

     

    The NULLS are needed rather than zeros otherwise the average is affected by the extra rows.

     

    It would be amazing if in future versions of PowerBI it was possible to perform calculations on values used in the visualisations - although I appreciate this will have possible performance implications if missused.