Forum Discussion

Pri's avatar
Pri
Frequent Visitor
7 years ago
Solved

Creating slicer when data is in different columns

I have data in three different columns and I want to create a slicer with this data.

 

Please suggest a way to do the same.

  • Hi Pri ,

     

    Go to power query as the picture as below.

     

    Then choose all the columns and upivot columns as the picture below.

     

6 Replies

    • Pri's avatar
      Pri
      Frequent Visitor

      Sample Data :

       

      Total ValueInternal ValueExternal Value
      1004060
      703040

       

      Expected Output:

       

      Slicer with three options in dropdown : Total Value, Internal Value, External Value

      • mussaenda's avatar
        mussaenda
        Community Champion

        Based on your provided data, try this:

         

        let
            Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwUNJRMgERZgZKsTrRSuYgtjFUNDYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Total Value" = _t, #"Internal Value" = _t, #"External Value" = _t]),
            #"Changed Type" = Table.TransformColumnTypes(Source,{{"Total Value", Int64.Type}, {"Internal Value", Int64.Type}, {"External Value", Int64.Type}}),
            #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {}, "Attribute", "Value")
        in
            #"Unpivoted Columns"