- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Rename Nested Tables Based on Condition
Hello. I have a column named "Custom" which has nested tables, and I would like to conditionally rename the columns within the nested tables using the Text.Contains function. I thought my code below would achieve this, but it will only modify the parent column "Custom" rather than modifying the nested tables within. Thanks in advance for your time and help.
= let
Source = #"Added Custom",
RenamedColumns = Table.TransformColumnNames(Source, each if Text.Contains(_, "back", Comparer.OrdinalIgnoreCase)
then Text.Replace(_, _, "Back") else _)
in RenamedColumns
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @JNB3
You need to use Table.TransformColumns to apply the same transformation to each nested table within the Custom column.
On way to do this, is to first create a function that is similar to your RenamedColumns step (I called this RenameFunction), then apply this function using Table.TransformColumns in the ApplyRenameFunction step below.
let
// Define a function that will be applied to each nested table
RenameFunction = each Table.TransformColumnNames(
_,
each
if Text.Contains(_, "back", Comparer.OrdinalIgnoreCase) then
Text.Replace(_, _, "Back")
else
_
),
// Source table
Source = #"Added Custom",
// Apply the function to each nested table in the Custom column
ApplyRenameFunction = Table.TransformColumns(Source, {{"Custom", RenameFunction}})
in
ApplyRenameFunction
Does this work for you?
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @JNB3
You need to use Table.TransformColumns to apply the same transformation to each nested table within the Custom column.
On way to do this, is to first create a function that is similar to your RenamedColumns step (I called this RenameFunction), then apply this function using Table.TransformColumns in the ApplyRenameFunction step below.
let
// Define a function that will be applied to each nested table
RenameFunction = each Table.TransformColumnNames(
_,
each
if Text.Contains(_, "back", Comparer.OrdinalIgnoreCase) then
Text.Replace(_, _, "Back")
else
_
),
// Source table
Source = #"Added Custom",
// Apply the function to each nested table in the Custom column
ApplyRenameFunction = Table.TransformColumns(Source, {{"Custom", RenameFunction}})
in
ApplyRenameFunction
Does this work for you?
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Thank you so much! This worked perfectly! Thanks again!

Helpful resources
Join our Fabric User Panel
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Power BI Monthly Update - June 2025
Check out the June 2025 Power BI update to learn about new features.

User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |