May 1, 2019
I have a table X
I have a parameter that is a #of days 31 that needs to be entered every time we go into the query.
I would like to add that parameter into the table X so it can be used in calculations and such. I think I want to do a table.addcolumn but can not find instructions except in BI and we do not use BI we only use query.
I thought at one point I had the syntax but kept getting comma erros and eof errors and just could not get it to work. I want that Column one to have the value I entered into the parameter in it. for this one 31 called column1 is fine.
Can this be done in Power Query?
|7/1/2019||1||6/3/2019 0:00||5/22/2019 0:00||7/31/2019 0:00||151||151||5153437.5||5175000||17033||0|
|7/1/2019||1||3/1/2018 0:00||3/1/2018 0:00||7/31/2019 0:00||151||151||7280000||7312500||17033||0|
|7/1/2019||1||8/17/2011 0:00||8/16/2011 0:00||7/31/2019 0:00||151||151||184166.98||191250.31||17033||0|
|7/1/2019||1||7/20/2004 0:00||2/25/2019 0:00||6/13/2019 0:00||151||151||4345000||4345000||17033||0|
|7/1/2019||1||11/12/2002 0:00||11/7/2002 0:00||2/20/2019 0:00||151||151||610000||610000||17033||0|
|7/1/2019||1||1/28/2016 0:00||1/28/2016 0:00||7/3/2019 0:00||151||151||1082560.31||1088072.21||17033||0|
|7/1/2019||1||1/10/2017 0:00||1/10/2017 0:00||7/9/2019 0:00||955||955||37033.63||37346.9||17033||0|
|7/1/2019||1||11/9/2015 0:00||11/6/2015 0:00||7/6/2019 0:00||955||955||43166.31||43781.78||17033||0|
July 16, 2010
To add a column containing the number 31 on every row, simply go to Add Column > Custom Column > enter =31 > press OK.
Alternatively, if you want to add a 'Parameter' then you find these on the Home tab > Manage Parameters > New Parameter. The rest should be self-explanatory, but let us know if you get stuck.
May 1, 2019
I don't think that's what I want to do.
I have a parameter named numofdays that has been inputted as 31. I want to put that parameter where you have the 31. Each month the user needs to enter a different number in that paramenter so I can use it in formulas. So how do you get the parameter into that custom field?
July 16, 2010
Sorry, I don't understand. You said "I want to put that parameter where you have the 31." Where who has the 31? I can't see it in your example.
That said, if you have created a parameter via the Manage Parameters > New Parameter menu then you can 'Add Conditional Column' and choose parameters from the 'Value' and 'Output' drop down lists. See screenshot.
If that doesn't help, then please upload a sample Excel file showing me where your parameter is and explaining where you want it to appear with reference to your example file so we can understand what you're trying to do.