How make multiplication table 10x10

citizenbh

Board Regular
Joined
Sep 19, 2013
Messages
145
How make multiplication table 10x10 in Power Query or PowerPivot using the names of columns and rows
 
Last edited:

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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
 
Upvote 0
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"
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,685
Members
448,978
Latest member
rrauni

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top