Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hello folks,
Could you help me understand, how do I get value from a column when I do not know its name ? For example
myTable[Column5] - returns the value in Column5.
How do I return value from the column if I do not know its name? I only know that it is the 5th column in myTable?
Thanks!
Solved! Go to Solution.
If you are using Table.AddColumn, there is a very simple solution for this.
Put following in a custom column
= Record.ToList(_){4}
Yep, this is what I was looking for. Thank you !
myTable[Column5] would return a list of values from Column5.
Equivalent expression would be (Since PQ is 0 indexed, hence 4 is used in place of 5 below)
Table.Column(myTable,Table.ColumnNames(myTable){4})
Thanks @Vijay_A_Verma , I will experiment with this. I actually need to return not a list, but single value from a corresponding row.
The just use the index of that. Hence, if you need 7th row's value then use an index of 6 like below
Table.Column(myTable,Table.ColumnNames(myTable){4}){6}
I must be missing something, but I try this and it does not work as expected:
= Table.AddColumn(Source, "Custom", each Table.ColumnNames(Source) {4} )
I would expect this to return a corresponding row value from column 5 .
If you are using Table.AddColumn, there is a very simple solution for this.
Put following in a custom column
= Record.ToList(_){4}
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.