Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello everyone, thank you very much for reading my post. I am trying to transform this table.
I have a table with data that looks like this:
Is it possible to transform the table so that it is displayed like this?
attached pbix file in case someone could help me.
https://www.dropbox.com/s/2dmy8303ob6stqb/example.pbix?dl=0
thank you all in advance.
Solved! Go to Solution.
Hi @pakovic ,
According to your needs, I did a test in power query, and the following results can be used as a reference:
let
Origen = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fVA9C8IwEP0rR+YKySWnrsVJqEZoFykdOhQUWhXs/8crNfXQmIwv795XXStnNT8DK9j5wyk/nsGoTKkmq5XfF0Baw9AzYpi1oBt6oxjQ6j62PZRt3z2hvFwfQ3cbgXWZY+XlJDOfUkyP0nL4N4gV4JIZBYj0KZKysExZB4qv8gLCQnIfFyjzJ4r5MDof2/9GsekobhqEIr1MdFBMq5E0FMW+s28nx+YF", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Description = _t, Euro = _t]),
#"Tipo cambiado" = Table.TransformColumnTypes(Origen,{{"Description", type text}, {"Euro", Int64.Type}}),
Custom1 = Table.SelectRows(#"Tipo cambiado",each Text.Start([Description],5)<>"TOTAL"),
#"Added Custom" = Table.AddColumn(Custom1, "Customer", each if Text.Contains([Description], "COMPANY") then [Description] else null),
#"Filled Down" = Table.FillDown(#"Added Custom",{"Customer"}),
#"Filtered Rows" = Table.SelectRows(#"Filled Down", each ([Euro] <> null)),
Custom2 = Table.AddColumn(#"Filtered Rows", "Sales Shipment", each if Text.Contains([Description],"Sales Shipment")
then [Description]
else null),
#"Filled Up" = Table.FillUp(Custom2,{"Sales Shipment"}),
Custom3 = Table.SelectRows(#"Filled Up",each Text.Start([Description],5)<>"Total"),
#"Reordered Columns" = Table.ReorderColumns(Custom3,{"Customer", "Sales Shipment", "Description", "Euro"}),
#"Renamed Columns" = Table.RenameColumns(#"Reordered Columns",{{"Euro", "Item"}}),
Custom4 = Table.TransformColumns(#"Renamed Columns",{"Sales Shipment",each Text.End(_,3)})
in
Custom4
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @pakovic ,
According to your needs, I did a test in power query, and the following results can be used as a reference:
let
Origen = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fVA9C8IwEP0rR+YKySWnrsVJqEZoFykdOhQUWhXs/8crNfXQmIwv795XXStnNT8DK9j5wyk/nsGoTKkmq5XfF0Baw9AzYpi1oBt6oxjQ6j62PZRt3z2hvFwfQ3cbgXWZY+XlJDOfUkyP0nL4N4gV4JIZBYj0KZKysExZB4qv8gLCQnIfFyjzJ4r5MDof2/9GsekobhqEIr1MdFBMq5E0FMW+s28nx+YF", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Description = _t, Euro = _t]),
#"Tipo cambiado" = Table.TransformColumnTypes(Origen,{{"Description", type text}, {"Euro", Int64.Type}}),
Custom1 = Table.SelectRows(#"Tipo cambiado",each Text.Start([Description],5)<>"TOTAL"),
#"Added Custom" = Table.AddColumn(Custom1, "Customer", each if Text.Contains([Description], "COMPANY") then [Description] else null),
#"Filled Down" = Table.FillDown(#"Added Custom",{"Customer"}),
#"Filtered Rows" = Table.SelectRows(#"Filled Down", each ([Euro] <> null)),
Custom2 = Table.AddColumn(#"Filtered Rows", "Sales Shipment", each if Text.Contains([Description],"Sales Shipment")
then [Description]
else null),
#"Filled Up" = Table.FillUp(Custom2,{"Sales Shipment"}),
Custom3 = Table.SelectRows(#"Filled Up",each Text.Start([Description],5)<>"Total"),
#"Reordered Columns" = Table.ReorderColumns(Custom3,{"Customer", "Sales Shipment", "Description", "Euro"}),
#"Renamed Columns" = Table.RenameColumns(#"Reordered Columns",{{"Euro", "Item"}}),
Custom4 = Table.TransformColumns(#"Renamed Columns",{"Sales Shipment",each Text.End(_,3)})
in
Custom4
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Wow! Thank you very much. It works very well !!
@pakovic , refer if this blog can help you
https://www.thebiccountant.com/2015/08/12/how-to-pivot-multiple-measurescolumns-in-power-query/
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
67 |