Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
karimk
Helper III
Helper III

Help - How to Sum Scores and Count Unique People Results??

Hi everyone,

I need to make a donut chart that shows the amount of people per Result Category, but I´m stuck with the tables and data I have. 

 

Table A shows people, their goals, the weight of each goal and the result. It can have more than one row per person (more than one goal per person). Example below:

 

tabela 1.PNG

 

Each result corresponds to a number. Example below:

tabela 2.PNG

If I multiply the corresponding point by the weight, I get the Score.

If the SUM(score) of each unique person is <2, then it gets a final score of "Not Enough". If it´s ❤️ and >=2, then it´s "On Point". If it´s >=3, then it´s "Outstanding".

 

I need to know how many unique people have a final score of "Not Enough", "On Point" and "Outstanding".

 

Here is a dataset example link: OneDrive Link

 

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @karimk ,

 

You can create column and measure like DAX below.

 

Column:
Final score = var Score = Table1[Weight]*RELATED(Table2[Point]) var Sum_score= CALCULATE(SUMX(Table1,Score),FILTER(Table1,Table1[Person]=EARLIER(Table1[Person]))) return SWITCH(TRUE(), Sum_score <2,"Not Enough",Sum_score>=2&&Sum_score<3,"On Point",Sum_score>=3,"Outstanding")
Measure:
Count = CALCULATE(DISTINCTCOUNT(Table1[Person]),FILTER(ALLSELECTED(Table1),Table1[Final score]=MAX(Table1[Final score])))

Result:

41.png

 

 

 

 

You can download my test pbix file .

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-xicai
Community Support
Community Support

Hi @karimk ,

 

You can create column and measure like DAX below.

 

Column:
Final score = var Score = Table1[Weight]*RELATED(Table2[Point]) var Sum_score= CALCULATE(SUMX(Table1,Score),FILTER(Table1,Table1[Person]=EARLIER(Table1[Person]))) return SWITCH(TRUE(), Sum_score <2,"Not Enough",Sum_score>=2&&Sum_score<3,"On Point",Sum_score>=3,"Outstanding")
Measure:
Count = CALCULATE(DISTINCTCOUNT(Table1[Person]),FILTER(ALLSELECTED(Table1),Table1[Final score]=MAX(Table1[Final score])))

Result:

41.png

 

 

 

 

You can download my test pbix file .

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you very much @v-xicai 

Last question: If any of the result lines for a given person are blank, I want to classify that person as "Has not Filled Report". This is a condition to come before the Sum_score.

Example:

exemplo tabela.PNG

In the table above I would get a final score of:

On Point = 2 people

Has not Filled Report = 1 person

 

The updated dataset is here: Onedrive Link

danextian
Super User
Super User

You'll get a response faster if you provide a dummy data. Smiley Happy










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

 Thanks for the tip. I have put a link at the end of my original post.

Hi @karimk,

 

By sample/dummy data, I meant raw data that still needs to be processed and not your desired output. 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.