Forum Discussion
moizsherwani
9 years agoContinued Contributor
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...
- 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" - 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" - 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] ) )
Phil_Seamark
9 years agoMicrosoft Employee
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"moizsherwani
9 years agoContinued Contributor
Yes, your solution works perfectly, I am more a DAX fan so was wondering if there was a way to do this in Dax, otherwise your solution is the "BALL"
- Phil_Seamark9 years agoMicrosoft Employee
Try this for something a bit different in DAX
New Table = SELECTCOLUMNS(CALENDAR(DATE(1927,5,18),DATE(4637,11,26)),"n",int([Date]))