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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
MakSer
Regular Visitor

Select Columns with multiple column indexes

I am trying to select multiple columns by using column index numbers (instead of names) however below row throws an error ("Expression.SyntaxError: Token '}' expected.")

= Table.ColumnNames(#"Renamed Columns1"){2,3}

 

I expec from Table.ColumnNames to return names of the columns and select columns function to select only these columns.

= Table.SelectColumns(#"Renamed Columns1", Table.ColumnNames(#"Renamed Columns1"){2,3})

MakSer_0-1714640465988.png

I do not understand why it gives such an error because above rows works pefectly fine with single column index.

Is there any tip or shortcut for that? Thanks.

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

"I do not understand why it gives such an error because above rows works pefectly fine with single column index" - You can refer to one item of a list by index.  For more than one item you need to use List functions e.g. List.Range  or List.Combine or something else

View solution in original post

1 REPLY 1
HotChilli
Super User
Super User

"I do not understand why it gives such an error because above rows works pefectly fine with single column index" - You can refer to one item of a list by index.  For more than one item you need to use List functions e.g. List.Range  or List.Combine or something else

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.