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.
Hi,
Create a list in Power Query it's easy {[col1], [col2], [col3])
But how do you create a list when you have a variable number of columns ?
In my case, my headers' name are simple, it's [1], [2], [3], ..... But I don't know if I will have 5 columns or 50.
In that case, how to you convert the values of these columns into a List ?
Solved! Go to Solution.
You may change it as follows.
Record.ToList(Record.RemoveFields(_, {"Column1", "Column2"}))
You may simply add a custom column.
Record.ToList(_)
Ok Thanks Sam,
But if want all the columns except the first column or, like in my case, exclude the first 4 columns from your List. In that case, what do you do ?
You may change it as follows.
Record.ToList(Record.RemoveFields(_, {"Column1", "Column2"}))
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 |
---|---|
65 | |
63 | |
52 | |
37 | |
36 |
User | Count |
---|---|
82 | |
67 | |
61 | |
46 | |
45 |