cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
UlisesCiccola Frequent Visitor
Frequent Visitor

Analyzing Surveys with Power BI

Hi everybody,

 

I need to analyze a customer satisfaction survey with Power BI and I am having problems to build the visualizations. If it is necessary to unpivot a column, I would not know in what way in this case.

 

I pass the image to you. 

 recorte Encuesta Pwer BI.PNG

 

Thank you regards

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Analyzing Surveys with Power BI

Hi @UlisesCiccola ,

 

Here I made a sample for your referecen. Firstly, we should fill down the Preguntas column in power query.

 

fill.PNG

 

Then transform and Promoted Headers, after that we can unpivot the three columns to get the new table.

 

3.PNG

 

 

Capture.PNG

 

M code for youre reference.

 

let
    Source = Excel.Workbook(File.Contents("x:\xxxx\xxxxx\Book2.xlsx"), null, true),
    Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Pre", type text}, {"column1", type any}, {"column2", type any}, {"column3", type any}}),
    #"Filled Down" = Table.FillDown(#"Changed Type",{"Pre"}),
    #"Transposed Table" = Table.Transpose(#"Filled Down"),
    #"Promoted Headers1" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers1",{{"a", type text}, {"a_1", Int64.Type}, {"a_2", type number}, {"b", type text}, {"b_3", Int64.Type}, {"b_4", Int64.Type}, {"c", type text}, {"c_5", type number}, {"c_6", Int64.Type}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type1", {"a_1", "a_2", "b_3", "b_4", "c_5", "c_6"}, "Attribute", "Value")
in
    #"Unpivoted Columns"

If it doesn't meet your requirement, kindly share your sample data and excepted result to me.

 

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Community Support Team
Community Support Team

Re: Analyzing Surveys with Power BI

Hi @UlisesCiccola ,

 

Here I made a sample for your referecen. Firstly, we should fill down the Preguntas column in power query.

 

fill.PNG

 

Then transform and Promoted Headers, after that we can unpivot the three columns to get the new table.

 

3.PNG

 

 

Capture.PNG

 

M code for youre reference.

 

let
    Source = Excel.Workbook(File.Contents("x:\xxxx\xxxxx\Book2.xlsx"), null, true),
    Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Pre", type text}, {"column1", type any}, {"column2", type any}, {"column3", type any}}),
    #"Filled Down" = Table.FillDown(#"Changed Type",{"Pre"}),
    #"Transposed Table" = Table.Transpose(#"Filled Down"),
    #"Promoted Headers1" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers1",{{"a", type text}, {"a_1", Int64.Type}, {"a_2", type number}, {"b", type text}, {"b_3", Int64.Type}, {"b_4", Int64.Type}, {"c", type text}, {"c_5", type number}, {"c_6", Int64.Type}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type1", {"a_1", "a_2", "b_3", "b_4", "c_5", "c_6"}, "Attribute", "Value")
in
    #"Unpivoted Columns"

If it doesn't meet your requirement, kindly share your sample data and excepted result to me.

 

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Support Team
Community Support Team

Re: Analyzing Surveys with Power BI

Hi @UlisesCiccola ,

 

Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.