Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
gvg
Post Prodigy
Post Prodigy

How to get value from a column with unknown name

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!

1 ACCEPTED SOLUTION

If you are using Table.AddColumn, there is a very simple solution for this.

Put following in a custom column

= Record.ToList(_){4}

View solution in original post

6 REPLIES 6
gvg
Post Prodigy
Post Prodigy

Yep, this is what I was looking for. Thank you !

Vijay_A_Verma
Super User
Super User

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}

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors