Forum Discussion

dodiyal's avatar
dodiyal
Frequent Visitor
5 years ago
Solved

Unable to create report in Power Bi

Hello Team, I have one data set which i wish to convert into below mentioned table, can you help. Regional Support Location Customer Service Experience Turkey, Middle East, Africa, Southern ...
  • v-kkf-msft's avatar
    5 years ago

    Hi dodiyal ,

     

    Please try the following code in Power Query Editor: 

     

    let
        Source = Table.FromValue(#"Table"),
        #"Grouped Rows" = Table.Group(Source, {"Customer Service Experience"}, {{"Count", each Table.RowCount(_), Int64.Type}}),
        #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each [Count] / List.Sum(#"Grouped Rows"[Count])),
        #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Custom", Percentage.Type}}),
        #"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"Count"}),
        #"Added Custom1" = Table.AddColumn(#"Removed Columns", "Mode (Percent)", each "Customer Service Experience"),
        #"Pivoted Column" = Table.Pivot(#"Added Custom1", List.Distinct(#"Added Custom1"[#"Customer Service Experience"]), "Customer Service Experience", "Custom", List.Sum)
    in
        #"Pivoted Column"

     

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

    Best Regards,
    Winniz

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