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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Mariposa141
New Member

Importing multiple choice data from SurveyMonkey

Hi everyone,

 

I'm trying to import multiple choice data collected via SurveyMonkey into Power BI (our SurveyMonkey plan doesn't include the Power BI connector). I'm pretty new to Power BI and I'm struggling to import it. I wondered if someone in the community might be able to help?

 

Many thanks in advance for any suggestions!

 

My data looks something like this:

Respondent IDWhich of the following activities
do you carry out at least once per month?
(Select all that apply)
       
1Physical exercise MeditationListening to musicReadingEating outCinema 
2Physical exerciseComputer games Listening to musicReadingEating outCinema 
3      Cinema 
4Physical exercise MeditationListening to musicReadingEating outCinema 
5Physical exercise  Listening to music    
6Physical exerciseComputer games   Eating out  
7Physical exerciseComputer games      
8   Listening to musicReading   
9Physical exercise   Reading   
1 ACCEPTED SOLUTION

So, You have to import the data as I suggested earlier first. Then the below transformation steps must be taken in Power Query Editor before loading to excel:

 

1. At the beginning, Power Query Editor looks like this:

leogiangsyd_0-1710590476293.png

2. make row #1 as column header: Home --> transform group --> choose "user First Row as Header"

leogiangsyd_1-1710590567853.png

3. filter the first column and untick (null) which means "blank cell":

leogiangsyd_2-1710590601159.png

4. rename the "answer" columns (#2 to #8) to match with the activity option names

leogiangsyd_3-1710590734601.png

5. unpivot those answer columns (#2 to #8): choose those columns --> right click mouse on any chosen cells --> select "unpivot column"

leogiangsyd_4-1710591865709.png

6. You can delete either "Attribute" or "Value" column. Now you already have the wanted result with the respondent IDs (which repeat multiple times depending on how many activities chosen) and their corresponding answers - you can randomly check IDs 1 & 3 which meet your demand.

 

If you think my suggestion is helpful, please give me a "kudo" leogiangsyd_5-1710592187405.png  thanks.

 

View solution in original post

5 REPLIES 5
dufoq3
Super User
Super User

Hi @Mariposa141, for future requests, provide also expected result based on sample data please.

This approach is similar to @leo-giang-syd, but dynamic.

 

Result:

dufoq3_1-1710594709242.png

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("tVFNSwNBDP0rYU8Kvaj16+SheigoSD14WHoIs2knMDNZdrLq/nvTWqkt3ZYWhAnk673kZcqymFCuJVWUFMaPxaB49+w8yAzUE8wkBPnkNAd0yh+sTNl6tt90UBaVQCctOGyaDqRVQIVAmBUkOYKaGoiS1D/swK8ozt4okDNkCDbd8FjXoTu3MvTaAndh3qvvMjsMQF/UOM606nihihWVJVnwzFkpLeSoQGwNYMkJYWUp856sz2q2vAUjThRxyX/Zwz+SWLdqwuYYl3eB02dc7VH5p234z1Kv9/D3qtv8jZtjrvVrG/v88NyewrNe424re+Aga+D9gRPALtz0Gw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t, Column5 = _t, Column6 = _t, Column7 = _t, Column8 = _t]),
    RemovedTopRowsDynamic = Table.Skip(Source, each [Column1] <> "1" and [Column1] <> 1),
    TrimmedTextDynamic = Table.TransformColumns(RemovedTopRowsDynamic, List.Transform(Table.ColumnNames(RemovedTopRowsDynamic), (colName)=> {colName, each if Text.Trim(_) = "" then null else Text.Trim(_)})),
    UnpivotedOtherColumns = Table.UnpivotOtherColumns(TrimmedTextDynamic, {"Column1"}, "Attribute", "Answer"),
    RemovedColumns = Table.RemoveColumns(UnpivotedOtherColumns,{"Attribute"}),
    RenamedColumns = Table.RenameColumns(RemovedColumns,{{"Column1", "Respondent ID"}})
in
    RenamedColumns

 


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Mariposa141
New Member

Thanks for the reply.  I realised my question wasn't very clear - at the moment the multiple choice answers are spread across multiple columns, as in the data above. I would like to import the data as a single question so that I can easily analyse the findings. Thank you!

So, You have to import the data as I suggested earlier first. Then the below transformation steps must be taken in Power Query Editor before loading to excel:

 

1. At the beginning, Power Query Editor looks like this:

leogiangsyd_0-1710590476293.png

2. make row #1 as column header: Home --> transform group --> choose "user First Row as Header"

leogiangsyd_1-1710590567853.png

3. filter the first column and untick (null) which means "blank cell":

leogiangsyd_2-1710590601159.png

4. rename the "answer" columns (#2 to #8) to match with the activity option names

leogiangsyd_3-1710590734601.png

5. unpivot those answer columns (#2 to #8): choose those columns --> right click mouse on any chosen cells --> select "unpivot column"

leogiangsyd_4-1710591865709.png

6. You can delete either "Attribute" or "Value" column. Now you already have the wanted result with the respondent IDs (which repeat multiple times depending on how many activities chosen) and their corresponding answers - you can randomly check IDs 1 & 3 which meet your demand.

 

If you think my suggestion is helpful, please give me a "kudo" leogiangsyd_5-1710592187405.png  thanks.

 

This worked great, thanks so much for your help!

leo-giang-syd
Frequent Visitor

In this case, you need to download the datasets in excel, csv, PDF or similar formats then you can import them into power query (Data tab --> Get data --> choose datasource format ...), instead of feeding data directly from that website.

 

Whenever you need the update the data, please save the new dowloaded file, and then refresh the respective query in power query or simply click "refresh all" in Data tab.

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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