Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Table filtering

Dear friends! Could you help me with a simple question I have a simple table :    Name Language : English Language : French Language : Russian Adina  Intermediate Basic knowledge Adva...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi  Anonymous,

     

    After you load the data in the format you had pasted. Using the query editor you will have to unpivot the other Columns - Language : English , Language : French , Language: Russian

    I have psted thee screen shot.

     

    This will then create the table like

     

     

    Now change the column name Attribute as Language, Value as Level

    Then replace the Language : with null, that is to remove the word Language :

     

    Save and Close.

     

    With the table with just 3 columns Name, Language and Level. Use Language and Level in 2 slicers.  Create a Table visual with Name .

     

    You will get the desired output.

     

    Cheers

     

    CheenuSing

     

     

  • v-diye-msft's avatar
    v-diye-msft
    7 years ago

    Hi Anonymous ,

     

    Please use the M code:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckzJzEs8tEBJR8kzryS1KDc1JTOxJBXIdUoszkxWyM7LL89JTUkHiTimlCXmJaemKMXqAPXlpFYk5qWkFoH1+uUrJOfnFqSWpAIVYJqFKg3S7gk0ipA6NBt9EyvASsoyk7Gpda0oSC0qUYqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Name = _t, #"Language : English" = _t, #"Language : French" = _t, #"Language : Russian" = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Language : English", type text}, {"Language : French", type text}, {"Language : Russian", type text}}),
        #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Name"}, "Attribute", "Value"),
        #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns",{{"Attribute", "Language"}, {"Value", "Skill"}})
    in
        #"Renamed Columns

    Pbix attached.