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
ctwig76
Regular Visitor

Unroll JSON and include prefix

Hello,

I'm unrolling JSONs with shifting tag names. I need to include the parent tag name as a prefix as sometimes the nested tags have the same tag name

 

 

#"Expanded sessions.geo_info.country" = Table.ExpandRecordColumn(#"Renamed Columns5", "country", List.Buffer(List.Union(List.Transform(#"Renamed Columns5"[country], each Record.FieldNames(_))))),

 


Can someone advise how I can add "country." as a prefix to the field names that are expanded?

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @ctwig76 ,

 

You can try using the following function to modify the column name by merging the parent tag name as a prefix:

Table.TransformColumnNames - PowerQuery M | Microsoft Learn

Table.RenameColumns - PowerQuery M | Microsoft Learn

 

 

Best Regards,

Liu Yang

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

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.