Forum Discussion
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!
| UserID | Category | Category Score | Total Score |
| U8546 | 1 | 4 | 14 |
| U8546 | 2 | 8 | 14 |
| U8546 | 3 | 2 | 14 |
| U2244 | 1 | 3 | 9 |
| U2244 | 2 | 5 | 9 |
| U2244 | 3 | 1 | 9 |
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
- parry2k
Super User
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.⚡
- AnonymousNot applicable
This worked perfectly! Thank you for taking time to help.
- parry2k
Super User
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.⚡