Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi everyone,
I have a PowerBI File with a lot of diffent tables and queries. In one of these queries I would like to declare a variable called myVar, which contains a indefinite number of values separated by a semicolon. Example:
myVar = "Test1;Test2;Test3;Test4"
This variable is then further used in my query, which is not described in this post.
I now have an Excel File containing these values in one Column. Example:
Now my PowerQuery Question: How do i get the data of this Excel File into my PowerBI Data Model so that I can use it in a query as variable in the format as shown above?
I played around with parameters and combining data and so on but I did not come closer to a solution.
Any ideas?
BR
Julian
Solved! Go to Solution.
Hello @JulianC8 - you can use the Excel workbook connector (New Source > Excel Workbook) to connect to your Excel file and get you data. Once you have the data from Excel you can drill down to the values which creates a list. Then name the list myVar.
You're welcome! If your intent is to add a new column with a list of values separated by a semi-colon, you would do it like this....
= Table.AddColumn(PreviousStep, "Custom", each Text.Combine ( myVar, ";" ), type text )
Even better! Thanks a lot!
Hello @JulianC8 - you can use the Excel workbook connector (New Source > Excel Workbook) to connect to your Excel file and get you data. Once you have the data from Excel you can drill down to the values which creates a list. Then name the list myVar.
Hi @jennratten
Wow, it was really that easy. Thanks a lot!
One remark to round up the solution to my initial problem. In my query I now use the myVar and create a new column out if it (see step "AddCol"). After that I added the second line ExtractValues to get a list of values separated by Semicolons, as I wanted to have.
AddCol = Table.AddColumn(Source, "myColName", each myVar),
ExtractValues = Table.TransformColumns(AddCol , {"myColName", each Text.Combine(List.Transform(_, Text.From), ";"), type text}),
BR
Julian
You're welcome! If your intent is to add a new column with a list of values separated by a semi-colon, you would do it like this....
= Table.AddColumn(PreviousStep, "Custom", each Text.Combine ( myVar, ";" ), type text )
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |