Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Reading through Columns

Is there a way PowerBI can analyse this column from the table and tell me in numbers how many docks, how many headsets etc        amitchandak   
  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    4 years ago

    Use below Query

    let
        Source = Excel.CurrentWorkbook(){[Name="Table4"]}[Content],
        #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(Source, {{"Item Description", Splitter.SplitTextByDelimiter("/", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Item Description"),
        #"Trimmed Text" = Table.TransformColumns(#"Split Column by Delimiter",{{"Item Description", Text.Trim, type text}}),
        #"Split Column by Delimiter1" = Table.SplitColumn(#"Trimmed Text", "Item Description", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv), {"Item Description.1", "Item Description.2"}),
        #"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter1",{{"Item Description.1", Int64.Type}, {"Item Description.2", type text}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Item Description", each Text.TrimEnd([Item Description.2],"s")),
        #"Grouped Rows" = Table.Group(#"Added Custom", {"Item Description"}, {{"Total", each List.Sum([Item Description.1]), type nullable number}})
    in
        #"Grouped Rows"