Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Stacked column chart - help

Hi,    I have tried to look up for it in the internet but couldnt find any answers that would give me answers to my problem so I am posting here.    I am trying to create a stacked column chart v...
  • v-jianboli-msft's avatar
    4 years ago

    Hi Anonymous ,

     

    Please try:

    First, Unpivot your columns:

    Output:

    Here is the M code:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("tVRLDsIgEL1Kw5pLqHFr3JMukI6GpAIhjfH4xphYfgMIdTfD/B7vMTBGjk8DdiF0Nc5WX6WQoN7OHm5SKbBkpMyPHPTdwPKxd9ODKwHT8E0PKt1krws+LAYWGhEkFB+K5aTVwI2ZpeCXGZCbBElhjxIRiXIcdSX5uNMJtp6p0sE/qE4BTRbh0eq56X3wnLhTJJQzo0h3u8K5OM2psMWiFe+1yRfzw0I5qegngBV0atNd0/TaMwqu/TpFbP5EnPNKDrItEYnGFw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Lean six sigma white belt" = _t, #"Lean six sigma yllow belt" = _t, #"Lean sik sigma green belt" = _t, #"Lean six sigma black belt" = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Lean six sigma white belt", type text}, {"Lean six sigma yllow belt", type text}, {"Lean sik sigma green belt", type text}, {"Lean six sigma black belt", type text}}),
        #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {}, "Attribute", "Value")
    in
        #"Unpivoted Columns"

    Then apply it to the chart:

    Final output:

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.