Forum Discussion
create parameter from concatenation
- 3 years ago
It seems that it's not possible to create parameters from other parameters (unless you query parameters, which is not applicable in my scenario). The solution is...
1) create the following 3 parameters:
parameter A = 'some super long path'
parameter B = \Excel_file1.xlsx'
parameter C = '\Excel_file2.xlsx'
2) and then concatenate the parameters at the query level, e.g.:
let
FullFilePath = #"parameter A" & #"parameter B",
Source = Excel.Workbook(File.Contents(FullFilePath ), null, true),...
mr_wizard , You can use M parameter and use it in the creation of a new column https://learn.microsoft.com/en-us/power-query/power-query-query-parameters
= [Paramater] & [File Name]
Or you can have static ur and create a column in power query or dax
"URL" & [File Name]
- mr_wizard3 years ago
Resolver I
amitchandak Are you saying that it's not possible to create parameters from other parameters? In other words, for my scenario, I have to materialize my list of Excel workbooks as a single-column table by appending my parameter with strings?
- amitchandak3 years ago
Super User
mr_wizard , Are you looking to change the source string only? I was thinking of creating links for different files. see if this can help
refer, video from Guyinacube - How connection is using parameter
https://www.youtube.com/watch?v=XIq5vN5oPf8
https://www.youtube.com/watch?v=OnaDJkGOmIE
Infact you can use it in url
source =Parameter + "abc.Xls"
Also, you can create a list
https://radacad.com/change-the-source-of-power-bi-datasets-dynamically-using-power-query-parameters
- mr_wizard3 years ago
Resolver I
Those links don't apply to my specific situation (at least, I don't think). My situation is more generic. To be more clear, let's say that I have the following two sources:
1) 'some super long path'\Excel_file1.xlsx
2) 'some super long path'\Excel_file2.xlsx
Even though I won't be changing the sources, it's still a good idea to parameterize them. At a minimum, I would create two parameters (one for each source). But, since 'some super long path' is the same path in both sources / parameters, I was hoping to make that some sort of constant (parameter?) that is available to both sources. I was hoping that the solution would be something like:
parameter A = 'some super long path'
parameter B = parameter A + '\Excel_file1.xlsx'
parameter C = parameter A + '\Excel_file2.xlsx'
But, that doesn't seem to be permissible. As far as I know, the "list" solution (create parameter for 'some super long path', create list holding the Excel workbook names, create parameter that queries the list) won't work for me, as it requires a current value (a value that must be used by both sources), which defeats the purpose.