Forum Discussion

moizsherwani's avatar
moizsherwani
Continued Contributor
9 years ago
Solved

Create A Number Table

Hello everyone,   So since there is not a way to get a userinput box I am reverting to creating a table of numbers and having the user select via a slicer (they need to select their salary) and I h...
  • Phil_Seamark's avatar
    9 years ago

    Hi moizsherwani,

     

    Try a blank query in the Query Editor and paste this in to the advanced editor

     

    let
        Source = List.Generate(()=>10000, each _ < 1000000, each _ + 1),
        #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
    in
        #"Converted to Table"

      

  • Phil_Seamark's avatar
    Phil_Seamark
    9 years ago

    Did you try pasting this into the Advanced Editor?

     

    let
        Source = List.Generate(()=>10000, each _ < 1000000, each _ + 1),
        #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
    in
        #"Converted to Table"

  • OwenAuger's avatar
    9 years ago

    I don't recommend creating a DAX calculated table for this, but if you wanted to for fun you could use this:

    NumberTable =
    VAR MinNumber = 10000
    VAR MaxNumber = 1000000
    RETURN
        SELECTCOLUMNS (
            CALENDAR ( MinNumber, MaxNumber ),
            "Number", INT ( [Date] )
        )