Forum Discussion
Help with data exported from Excel
- 2 years ago
Hello Anonymous
Transform your data from the original format to the following one:
1) Unpivot all columns except participant2) Split Year and Event by delimiter (ex: "Edição 2020" -> "Edição", "2020")
3) Rename columns and change data types
Here is a sample Power Query code (it uses Enter Data for demo purposes, replace your "source" to connect to your data)
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSwYNjdaKVjKA8A6wYpMIYTZ8BChukwgSLXoRKkApTDH3ItsbGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Participante = _t, #"Edição 2020" = _t, #"Pitch 2020" = _t, #"Aceleração 2020" = _t, #"Edição 2021" = _t, #"Pitch 2021" = _t, #"Imersão 2021" = _t, #"Aceleração 2021" = _t]), #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Participante"}, "Attribute", "Value"), #"Split Column by Delimiter" = Table.SplitColumn(#"Unpivoted Other Columns", "Attribute", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, false), {"Attribute.1", "Attribute.2"}), #"Renamed Columns" = Table.RenameColumns(#"Split Column by Delimiter",{{"Attribute.1", "Evento"}, {"Attribute.2", "Ano"}}), #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Ano", Int64.Type}, {"Value", Int64.Type}}) in #"Changed Type"This way you will be able to filter freely by event and years and find the participants with value 1 or Yes
Pedro Reis - Data Platform MVP / MCT
Making Power BI and Fabric Simple
If my response resolved your issue, please mark it as a solution to help others find it. If you found it helpful, please consider giving it a kudos. Your feedback is highly appreciated!
Find me at LinkedIn
Hello Anonymous
Transform your data from the original format to the following one:
1) Unpivot all columns except participant
2) Split Year and Event by delimiter (ex: "Edição 2020" -> "Edição", "2020")
3) Rename columns and change data types
Here is a sample Power Query code (it uses Enter Data for demo purposes, replace your "source" to connect to your data)
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSwYNjdaKVjKA8A6wYpMIYTZ8BChukwgSLXoRKkApTDH3ItsbGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Participante = _t, #"Edição 2020" = _t, #"Pitch 2020" = _t, #"Aceleração 2020" = _t, #"Edição 2021" = _t, #"Pitch 2021" = _t, #"Imersão 2021" = _t, #"Aceleração 2021" = _t]),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Participante"}, "Attribute", "Value"),
#"Split Column by Delimiter" = Table.SplitColumn(#"Unpivoted Other Columns", "Attribute", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, false), {"Attribute.1", "Attribute.2"}),
#"Renamed Columns" = Table.RenameColumns(#"Split Column by Delimiter",{{"Attribute.1", "Evento"}, {"Attribute.2", "Ano"}}),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Ano", Int64.Type}, {"Value", Int64.Type}})
in
#"Changed Type"
This way you will be able to filter freely by event and years and find the participants with value 1 or Yes
Pedro Reis - Data Platform MVP / MCT
Making Power BI and Fabric Simple
If my response resolved your issue, please mark it as a solution to help others find it. If you found it helpful, please consider giving it a kudos. Your feedback is highly appreciated!
Find me at LinkedIn
- Anonymous2 years agoNot applicable
Ty so much, i just had to do some trials and error with the code you gave me and it worked. Also, u have explained it amazingly well, so it was easy to get.
Have a nice week, ty.