Forum Discussion

crizbe's avatar
crizbe
New Member
4 years ago
Solved

Line chart points from columns

I have the following SharePoint lists: Plans: Plan Curve Description Plan001 Curve001   Plan002 Curve002     Curves: Curve ValueA MeasureA ValueB MeasureB Curve001 1...
  • lbendlin's avatar
    lbendlin
    4 years ago

    Here is one possible approach

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wci4tKks1MDBU0lEyNAATINIUxozVgSsxAgoZgcSNQYQJiLAAKogFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Curve = _t, ValueA = _t, MeasureA = _t, ValueB = _t, MeasureB = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Curve", type text}, {"ValueA", Int64.Type}, {"MeasureA", Int64.Type}, {"ValueB", Int64.Type}, {"MeasureB", Int64.Type}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "List", each {{[ValueA],[MeasureA]},{[ValueB],[MeasureB]}}),
        #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Curve", "List"}),
        #"Expanded List" = Table.ExpandListColumn(#"Removed Other Columns", "List"),
        #"Extracted Values" = Table.TransformColumns(#"Expanded List", {"List", each Text.Combine(List.Transform(_, Text.From), "#(tab)"), type text}),
        #"Split Column by Delimiter" = Table.SplitColumn(#"Extracted Values", "List", Splitter.SplitTextByDelimiter("#(tab)", QuoteStyle.Csv), {"x", "y"}),
        #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"x", Int64.Type}, {"y", Int64.Type}})
    in
        #"Changed Type1"

     

     

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi crizbe ,

     

    I think you can create a relationship between Plan table and Curve table by [Curve] column.

    For reference: Create and manage relationships in Power BI Desktop

    Then you can create a slicer by [Plan] column from Plan table. 

    By default:

    Select Plan001:

    Select Plan002:

     

    Best Regards,
    Rico Zhou

     

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