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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
se2
Helper II
Helper II

Table.ExpandTableColumn M code/query

Hello,

Is it possible to take the following, taken from the Advanced Editor in Power BI Desktop, and turn it into a function that I could then ivoke, as I use this line many times in my queries.  (I thought I posted this yesterday but I don't see it anywhere.)  Thank you, SE

 

I can't figure out to use a "=>" with this.

 

#"Expanded table.Data" = Table.ExpandTableColumn(#"Kept First Rows", "table.Data", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8"}, {"table.Data.Column1", "table.Data.Column2", "table.Data.Column3", "table.Data.Column4", "table.Data.Column5", "table.Data.Column6", "table.Data.Column7", "table.Data.Column8"}),

5 REPLIES 5
dax
Community Support
Community Support

Hi @se2 

I am not clear about your requirement, if possible could you please inform me more detailed information(such as your expected output and your sample data )? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@se2 , refer if these can help

https://eriksvensen.wordpress.com/2019/10/05/powerquery-control-the-expand-columns-so-it-includes-ne...

https://datachant.com/2017/02/07/power-bi-pitfall-9/

https://www.youtube.com/watch?v=wG3J8lO9d5I

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I am studying these.  Thank you. SE

parry2k
Super User
Super User

@se2 what you are trying to achieve?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I am importing an Excel file.  I find myself using one of the power query steps, over and over, so would like to convert this to a function that I can invoke.  The step is but I can't figure out how or where to use variables to convert the follow to a function that I can use add column and invoke custom with.  Thank you SE

 

#"Expanded table.Data" = Table.ExpandTableColumn(#"Kept First Rows", "table.Data", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8"}, {"table.Data.Column1", "table.Data.Column2", "table.Data.Column3", "table.Data.Column4", "table.Data.Column5", "table.Data.Column6", "table.Data.Column7", "table.Data.Column8"}),

 

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.