Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Creating a Sum column with some specific conditions

Hello, I am new to PowerBI and am trying to find a quick way to calculate the Total Score column as shown below. I would like it to sum each category score and display that for each row where the UserID is the same. Below I've given an example with two UserID's, showing each individual category score, and how I would like to format the total score for each row instance of the UserID. Thanks for any help!

 

UserIDCategoryCategory ScoreTotal Score
U85461414
U85462814
U85463214
U2244139
U2244259
U2244319
  • Anonymous you can do something like this, add as a measure

     

    Measure = CALCULATE ( SUM  ( 'Table'[Category Score] ), ALLEXCEPT ( 'Table', 'Table'[UserID] ) )

     

    Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

3 Replies

  • Anonymous you can do something like this, add as a measure

     

    Measure = CALCULATE ( SUM  ( 'Table'[Category Score] ), ALLEXCEPT ( 'Table', 'Table'[UserID] ) )

     

    Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

    • Anonymous's avatar
      Anonymous
      Not applicable

      This worked perfectly! Thank you for taking time to help.

  • Anonymous or 2nd measure, it will work if you want to have the total change based on the slicer.

     

    Measure 2 = CALCULATE ( SUM ( 'Table'[Category Score] ), ALLSELECTED (), VALUES ( 'Table'[UserID] ) ) 

     

    Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.