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
Anonymous
Not applicable

Google Form Visualization

New to Power BI, please help

 

Hi Everyone,

I made a google form with a dropdown list that connects to the answer's dedicated section. The responses came back with answers of only the intended section filled. The inputs are checkbox (Yes/No/Other) and I'm trying to create a stacked bar chart of the responses count.

 

I need a way to not hard code the tables since the google form is linked. The data sample, transformed table, and target chart are provided.

 

 

 

Data SampleData Sample

 

Transformed Table (Manual)Transformed Table (Manual)

 

Target.jpg

 

Along the way, I would also like to add slicers for the different types of items. If you have a simpler approach to get to the target chart please post it 🙂 

 

 

I did use excel and used vlookup and countif, but I can't find a way to replicate them in Power BI.

 

Thank you for your help.

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@Anonymous  It might be nice to keep one table that has one row per respondent? See if this webinar on survey data gives you any inspiration: https://www.excelwithallison.com/MCT/news#h.p_NkgcNxVFFYaS

I didn't get too complex in this one, but I do often do what you have done by creating a column for 'question' and column for 'response'. I just think you're missing the Dim and Fact table concept to be able to create exactly the chart you want. https://excelwithallison.blogspot.com/2020/08/its-complicated-relationships-in-power.html 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

New to Power BI, please help

 

Hi Everyone,

I made a google form with a dropdown list that connects to the answer's dedicated section. The responses came back with answers of only the intended section filled. The inputs are checkbox (Yes/No/Other) and I'm trying to create a stacked bar chart of the responses count.

 

I need a way to not hard code the tables since the google form is linked. The data sample, transformed table, and target chart are provided.

 

Data SampleData Sample

 

Transformed Table (Manual)Transformed Table (Manual)

 

 

Target.jpg

 

Along the way, I would also like to add slicers for the different types of items. If you have a simpler approach to get to the target chart please post it 🙂

 

I did use excel and used vlookup and countif, but I can't find a way to replicate them in Power BI.

 

Thank you for your help.

Stachu
Community Champion
Community Champion

The transfromation would be somthing like this (you can paste it to Advanced Editor in the Transform Data interface):

 

let
    Source = Excel.CurrentWorkbook(){[Name="Table"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Type"}, "Question", "Answer"),
    #"Grouped Rows" = Table.Group(#"Unpivoted Other Columns", {"Type", "Question", "Answer"}, {{"Total", each Table.RowCount(_), Int64.Type}})
in
    #"Grouped Rows"

 

you just need to replace the Source step with your table



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

AllisonKennedy
Super User
Super User

@Anonymous  It might be nice to keep one table that has one row per respondent? See if this webinar on survey data gives you any inspiration: https://www.excelwithallison.com/MCT/news#h.p_NkgcNxVFFYaS

I didn't get too complex in this one, but I do often do what you have done by creating a column for 'question' and column for 'response'. I just think you're missing the Dim and Fact table concept to be able to create exactly the chart you want. https://excelwithallison.blogspot.com/2020/08/its-complicated-relationships-in-power.html 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Hi! Thank you for the webinar link! It really helps in creating the charts I want, but I have a question regarding the fact tables. Since the tables are unpivoted for each question,  will the new entries be in the format of the fact tables when I refresh the data? Because the PBIX is directly linked to the survey's Google Spreadsheet.

@Anonymous  You're very welcome, glad it helps! 🙂 

 

Everything you do in Power Query is saved, so since the pbix is linked directly to the Google Spreadsheet, every time you refresh the data, Power BI will follow every step you created in Power Query. It starts by going to the Google Spreadsheet and grabbing all the rows, then transforms, unpivots, references, adds index column, etc. So the final result is yes, the new entries will be in the format of the fact tables when you refresh the data. Such a fun tool! Let me know if you have more questions around that.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Thank you so much for the explanation!! I've been reading a lot about Power Query so this really makes sense 🙂 

Anonymous
Not applicable

Thank you for the response!! 

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.