Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi,
I'm new to Power BI and I can't figure out how to count the number of occurence of each answer from a multiple choice sharepoint form :
I have :
Project ¦ Choice
Project1 ¦
Project2 ¦ Choice1
Project3 ¦ Choice1, Choice2
Project4 ¦ Choice3, Choice4
Project5 ¦ Choice1, Choice2, Choice3
...
And I would like to obtain
Choice ¦ number of occurence
Choice1 ¦ 3
Choice2 ¦ 2
Choice3 ¦ 2
Choice4 ¦ 1
....
The list of choices is not defined by a separate sharepoint list. I have searched through the forum and have found several subject discussing similar topics but still haven't found a way to implement this. Any help?
Solved! Go to Solution.
Hi @shugs,
If you data is in that format you present first of all you need to change you information format.
Go to the query editor and do the following steps:
Now just add you Value to the table visual and the Project (this should be count)
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsI have similar problem. But some columns (Response to Survey) are subjective response and the sentences may actually have a comma in them. If I use the comma delimiter solution, this will be a problem. Any suggestions?
Thanks for all the answers!
Undoutbtedly you have other columns in that table - so duplicate the table first in the Query Editor
Here's a link to a similar question
http://community.powerbi.com/t5/Desktop/Data-modeling-question/m-p/135326#M57957
Plus the image
Alternative solution in Power Query:
Resulting code (in which I adjusted the step names for better readability):
let
Source = InputTable,
RemovedEmpties = Table.SelectRows(Source, each ([Choice] <> null)),
Splitted = Table.TransformColumns(RemovedEmpties,{{"Choice", each Text.Split(_, ",")}}),
RemovedProject = Table.RemoveColumns(Splitted,{"Project"}),
ExpandedChoice = Table.ExpandListColumn(RemovedProject, "Choice"),
Trimmed = Table.TransformColumns(ExpandedChoice,{},Text.Trim),
GroupedWithCount = Table.Group(Trimmed, {"Choice"}, {{"Number of occurrence", each Table.RowCount(_), type number}})
in
GroupedWithCount
Hi @shugs,
If you data is in that format you present first of all you need to change you information format.
Go to the query editor and do the following steps:
Now just add you Value to the table visual and the Project (this should be count)
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi,
This worked for me, thanks a lot!
But just to add - I worked with a data including more columns than the Project and Choice columns, and the Unpivot Columns solution removes the records with empty Choice column. So it's good to create a new table containing only the Project and Choice columns to avoid losing data.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 37 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 69 | |
| 67 | |
| 32 | |
| 27 | |
| 26 |