Results 1 to 3 of 3

Thread: How make multiplication table 10x10
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Sep 2013
    Posts
    118
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default How make multiplication table 10x10

    How make multiplication table 10x10 in Power Query or PowerPivot using the names of columns and rows
    Last edited by citizenbh; Mar 31st, 2016 at 02:02 PM.

  2. #2
    New Member
    Join Date
    Apr 2015
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How make multiplication table 10x10

    Quite interesting task - i have solution without using source table, only by using List.Generate

    Code:
    let
        Source = List.Generate(()=> 10, each _ < 110, each _ + 1),
        ToTable = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
        Split = Table.SplitColumn(Table.TransformColumnTypes(ToTable, {{"Column1", type text}}, "en-US"),"Column1",Splitter.SplitTextByPositions({0, 1}, true),{"Column1", "Column2"}),
        ChangedType = Table.TransformColumnTypes(Split,{{"Column1", Int64.Type}, {"Column2", Int64.Type}}),
        ReplaceValue = Table.ReplaceValue(ChangedType,0,10,Replacer.ReplaceValue,{"Column2"}),
        SortRows = Table.Sort(ReplaceValue,{{"Column1", Order.Ascending}, {"Column2", Order.Ascending}}),
        AddColumn = Table.AddColumn(SortRows, "Mulitply", each [Column1]*[Column2]),
        PivotedColumn = Table.Pivot(Table.TransformColumnTypes(AddColumn, {{"Column2", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(AddColumn, {{"Column2", type text}}, "en-US")[Column2]), "Column2", "Mulitply")
    in
        PivotedColumn

  3. #3
    Board Regular
    Join Date
    Sep 2013
    Posts
    118
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How make multiplication table 10x10

    Thank you for your efforts. I am two days ago solve little different:

    Code:
    let
        Query1 = #table({"a","b"},{{{1..10},{1..10}}}),
        #"Expanded a" = Table.ExpandListColumn(Query1, "a"),
        #"Expanded b" = Table.ExpandListColumn(#"Expanded a", "b"),
        #"Added Custom" = Table.AddColumn(#"Expanded b", "10x10", each [a]*[b]),
        #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Added Custom", {{"b", type text}}, "bs-Latn-BA"), List.Distinct(Table.TransformColumnTypes(#"Added Custom", {{"b", type text}}, "bs-Latn-BA")[b]), "b", "10x10", List.Sum)
    in
        #"Pivoted Column"

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •