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
daidominguez
Frequent Visitor

Sum # Responses and grouping them by Category

Hi all!

I'm trying to sum the number of responses obtained from a survey & organising them in 3 categories.
In this case, I’ve got my 2 main columns:

 - Column "Answer": with 5 values (Highly Agree; Agree; Neutral; Disagree; and Highly Disagree). 
Column "#Responses": with the number of responses per category.

 
What I need to do is:
- Sum the number of responses by Category but grouping them together (using different columns or measures) as follows:
      * Positive: for Highly Agree and Agree responses
      * Neutral: for Neutral responses
      * Negative: for Disagree and Highly Disagree responses.

daidominguez_1-1593632592300.png


What's the best and easy way to do it? I'd appreciate your suggestions.

Thank you in advance for your help!

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @daidominguez ,

 

Please create calculated column like this.

 

Sum the number of responses by Category = 
CALCULATE(
    SUM(Sheet1[#Responses]),
    ALLEXCEPT( Sheet1, Sheet1[Answer] )
) 
grouping them together = 
SWITCH(
    [Answer],
    "Highly Agree", "Positive",
    "Agree", "Positive",
    "Neutral responses", "Neutral",
    "Disagree", "Negative",
    "Highly Disagree", "Negative"
)

 

 

Or measure like this.

 

Sum the number of responses by Category = 
CALCULATE(
    SUM(Sheet1[#Responses]),
    ALLEXCEPT( Sheet1, Sheet1[Answer] )
) 
grouping them together = 
SWITCH(
    MAX([Answer]),
    "Highly Agree", "Positive",
    "Agree", "Positive",
    "Neutral responses", "Neutral",
    "Disagree", "Negative",
    "Highly Disagree", "Negative"
)

 

qqq4.PNG

 

Best regards,
Lionel Chen

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

1 REPLY 1
v-lionel-msft
Community Support
Community Support

Hi @daidominguez ,

 

Please create calculated column like this.

 

Sum the number of responses by Category = 
CALCULATE(
    SUM(Sheet1[#Responses]),
    ALLEXCEPT( Sheet1, Sheet1[Answer] )
) 
grouping them together = 
SWITCH(
    [Answer],
    "Highly Agree", "Positive",
    "Agree", "Positive",
    "Neutral responses", "Neutral",
    "Disagree", "Negative",
    "Highly Disagree", "Negative"
)

 

 

Or measure like this.

 

Sum the number of responses by Category = 
CALCULATE(
    SUM(Sheet1[#Responses]),
    ALLEXCEPT( Sheet1, Sheet1[Answer] )
) 
grouping them together = 
SWITCH(
    MAX([Answer]),
    "Highly Agree", "Positive",
    "Agree", "Positive",
    "Neutral responses", "Neutral",
    "Disagree", "Negative",
    "Highly Disagree", "Negative"
)

 

qqq4.PNG

 

Best regards,
Lionel Chen

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

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.