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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors