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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
AlexMic
New Member

Multiple Response Question: Count responses stored in a single column, separated by a space

Hello community.. please your help..

From a multiple question in a quiz, a single column was generated that has all responses separated by a space. I want to build a bar graph that shows the number that appears for each answer and the % vs. the total number of respondents. In my file I have 1000 rows, one row for each respondent, and of course other questions so I don't want to impact the structure of the file.
Thanks for your suggestions.

 

AlexMic_2-1649537444330.png

 

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @AlexMic ,

 

If you do not have user name, add an index column to the original file. This can be used as a count of the total number of people.

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlSK1YGTOkkwWicZyoLQSUgkqkwyso5YAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Lugar = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Lugar", type text}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Added Index", {{"Lugar", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Lugar"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Lugar", type text}})
in
    #"Changed Type1"

 

Then create a measure like below:

 

Measure = 
var total_ =CALCULATE(DISTINCTCOUNT('Table (2)'[Index]),ALL('Table (2)'))
var current_row = COUNT('Table (2)'[Index])
return DIVIDE(current_row,total_)

 

Vlianlmsft_0-1649734685196.png

 


Best Regards,
Liang
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-lianl-msft
Community Support
Community Support

Hi @AlexMic ,

 

If you do not have user name, add an index column to the original file. This can be used as a count of the total number of people.

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlSK1YGTOkkwWicZyoLQSUgkqkwyso5YAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Lugar = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Lugar", type text}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Added Index", {{"Lugar", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Lugar"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Lugar", type text}})
in
    #"Changed Type1"

 

Then create a measure like below:

 

Measure = 
var total_ =CALCULATE(DISTINCTCOUNT('Table (2)'[Index]),ALL('Table (2)'))
var current_row = COUNT('Table (2)'[Index])
return DIVIDE(current_row,total_)

 

Vlianlmsft_0-1649734685196.png

 


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

AlexMic
New Member

thanks... it's the first step... but how do I calculate the % with respect to the number of people surveyed (number of rows in the original file).. no versus the number of responses? Thank you.

Hi,

You can use the DISTINCTCOUNT() function.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

You will have to split the answers by rows so that each answer is in its own cell.  This can easily be done in the Query Editor.  If you need further help, share the download link of your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Good morning, I have the same problem with comma separator. 😕

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors