Forum Discussion

unknown917's avatar
unknown917
Helper IV
5 months ago
Solved

Create rows from 2 tables

I have a refreshable table pulling in "Hub" & "Subset".  I have a "key" table with different criteria based on different options.  This is currently finite and probably brought in through an excel ta...
  • MFelix's avatar
    5 months ago

    Hi unknown917 ,

     

    Don't know if you have any column to add the number of rows in this case the 70 you can built a formula similar to this:

    { [Hub]*1000000 + [Groupsubset]*1000 + 1..  [Hub]*1000000 + [Groupsubset]*1000 + [Number of rows]}

     

    Full code below:

    let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjYyVNJRMgdhA6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Hub = _t, Groupsubset = _t, #"Number of rows" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Hub", Int64.Type}, {"Groupsubset", Int64.Type}, {"Number of rows", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each { [Hub]*1000000 + [Groupsubset]*1000 + 1.. [Hub]*1000000 + [Groupsubset]*1000 + [Number of rows]}),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom")
    in
    #"Expanded Custom"