cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

New Member

## Appended Table Summarised Results - Count a distinct value by ROW

Hi everyone,

I've found multiple topics about counting specific values but based on columns - I need that summarised by row in 'new columns'

In excel, the formula would be a simple  = COUNTIFS(ROW RANGE ,"VALUE")

Example of a table below (the results I need as an output is highlighted in RED)

Thank  you all x

 Question 1 Question 2 Question 3 Question 4 Question 5 Question 6 Question 7 Question 8 Strongly Agree Agree Disagree Strongly Disagree Row 1 Strongly Agree Agree Disagree Strongly Disagree Strongly Agree Agree Disagree Strongly Disagree 2 2 2 2 Row 2 Strongly Agree Agree Disagree Strongly Disagree Strongly Agree Agree Disagree Strongly Disagree 2 2 2 2 Row 3 Strongly Agree Agree Disagree Strongly Disagree Strongly Agree Agree Disagree Strongly Disagree 2 2 2 2
3 REPLIES 3

Hi  @Datastud3nt ,

then here's a different solution for your problem.

Open the Power Query Editor by clicking the Transform Data button in the upper tab menu:

If you then select your table you should see something similar like this:

Duplicate the existing answer table by right clicking on the table in the left Queries pane:

Then select the newly created table. I named it ANSWERS_PIVOT. Select all colums with answers except your Row column which is here represented by the Answer column.

Then do a right click and select Unpivot Columns.

The result should look somethink like this

Click Save and switch back to your report view.
There you create a measure for each answer like this:

``COUNT_STRONGLY_AGREE = CALCULATE(COUNTX('ANSWERS_PIVOT', 'ANSWERS_PIVOT'[Value]), 'ANSWERS_PIVOT'[Value] = "Strongly Agree")``

Hey @Datastud3nt ,
you can solve your problem by creating a new measure for each of the summary colums and use the following DAX code as example:

``````COUNT_STRONGLY_AGREE =

return q1+q2+q3+q4+q5+q6+q7+q8``````

This calculates the sum of Strongly Agree as answers. Add it as extra colum in your table visual and you'll see the result.

If this suggestions helps you please mark it as solution.

New Member

Hi @iceparrot thanks for your reply, however my dataset is an employee survey with 60 columns- that's why I wanted to create 4 different measures or columns and display the counts BY ROW.

The results of those 4 new columns will then feed another piece of analysis that will provide 'SENTIMENT' of the survey (based on the counts of agree/disagree/etc) -each employee will get a 'Sentiment Result' with values like positive, negative, slightly negative, sliglty positive or 50/50).

If that was done in excel the formula would be as simple as : COUNTIFS(ROW RANGE ,"VALUE")