Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have assigned a list to a parameter in Power Query -
Solved! Go to Solution.
Hi @asubr, I think you are asking if Power Query parameter could include multiple selections. The answer is yes and no. Power Query parameters do not allow a list of values as a parameter value. However, you can consider using the parameter as text string that contains the following examples:
FileName = "2015"
FileName = "2015, 2016"
FileName - "2015, 2016, 2017"
The trick is to convert the Text string into a Table with rows.
let
Source = #table(type table[FileName=text], { {FileName} }),
#"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(Source, {{"FileName", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "FileName"),
#"Trimmed Text" = Table.TransformColumns(#"Split Column by Delimiter",{{"FileName", Text.Trim, type text}})
in
#"Trimmed Text"
You now need to add the custom function to this table using this modified function
(FileName as text) as table =>
let
FullName = "File Name" & FileName & ".csv",
//Please refer to the SharePoint Site rather than the Folder Path.
Source = SharePoint.Files(#"SharePoint Site", [ApiVersion = 15]),
//I have added a Text Contains to select the folder. You could use the full path or end with instead.
#"Get File" = Table.SelectRows(Source, each [Name] = FullName and Text.Contains( [FolderPath] , "Folder Path" ) ),
#"Get Csv" = #"Get File"{0}[Content],
#"Imported CSV" = Csv.Document(#"Get Csv", [Delimiter = "|", Columns = 7, QuoteStyle = QuoteStyle.None]),
#"Promoted headers" = Table.PromoteHeaders(#"Imported CSV", [PromoteAllScalars = true])
in
#"Promoted headers"
Hi @asubr, I think you are asking if Power Query parameter could include multiple selections. The answer is yes and no. Power Query parameters do not allow a list of values as a parameter value. However, you can consider using the parameter as text string that contains the following examples:
FileName = "2015"
FileName = "2015, 2016"
FileName - "2015, 2016, 2017"
The trick is to convert the Text string into a Table with rows.
let
Source = #table(type table[FileName=text], { {FileName} }),
#"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(Source, {{"FileName", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "FileName"),
#"Trimmed Text" = Table.TransformColumns(#"Split Column by Delimiter",{{"FileName", Text.Trim, type text}})
in
#"Trimmed Text"
You now need to add the custom function to this table using this modified function
(FileName as text) as table =>
let
FullName = "File Name" & FileName & ".csv",
//Please refer to the SharePoint Site rather than the Folder Path.
Source = SharePoint.Files(#"SharePoint Site", [ApiVersion = 15]),
//I have added a Text Contains to select the folder. You could use the full path or end with instead.
#"Get File" = Table.SelectRows(Source, each [Name] = FullName and Text.Contains( [FolderPath] , "Folder Path" ) ),
#"Get Csv" = #"Get File"{0}[Content],
#"Imported CSV" = Csv.Document(#"Get Csv", [Delimiter = "|", Columns = 7, QuoteStyle = QuoteStyle.None]),
#"Promoted headers" = Table.PromoteHeaders(#"Imported CSV", [PromoteAllScalars = true])
in
#"Promoted headers"
Thanks so much Daryl!
You can assign the parameter as a list though, but looks like there is no way to iterate through the list in the parameter? The only solution is to treat it as text string and get it into a table and then iterate?
I hope i understood it correctly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
13 | |
12 | |
9 | |
8 |
User | Count |
---|---|
17 | |
9 | |
8 | |
7 | |
7 |