Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Help with data exported from Excel

Hello. I'm having a problem with one of my BI's and i didnt't find how to solve it. Can someone help me?   Well, i've got the following data (Those are the companys that have signed up and progress...
  • pmreis's avatar
    2 years ago

    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