cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hannisky
Frequent Visitor

Help with creating function

I'm trying to create a function that makes changes to tables before expanding. The starting point is as below a column of tables. 

Hannisky_0-1646225236527.png

My function at present takes a table and promotes headers. 

 

Hannisky_1-1646225399659.png

 

It kind of works as intended but not getting the correct result 

 

Hannisky_2-1646225543016.png

Each table in column c2 has another table and the table contained does not have promoted headers. Not sure where my syntax is incorrect. 

Hannisky_3-1646225576093.png

 

Any help would be appreciated.

 

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Hannisky ,

 

It looks like you should be invoking your function in a TransformColumns function, something like this:

 

Table.TransformColumns(Source, {"c1", each fnHeaders(_)})

 

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
BA_Pete
Super User
Super User

Hi @Hannisky ,

 

It looks like you should be invoking your function in a TransformColumns function, something like this:

 

Table.TransformColumns(Source, {"c1", each fnHeaders(_)})

 

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Perfect. Thank you

Helpful resources

Announcements
Join Arun Ulag at MPPC23

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors