Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi,
Something I have a workaround for but not happy with it is when I try to use custom function in Power BI and whant the name of the column as a parameter. In the example below:
fnParseColumn = (parTable as table, parNewColumnName as text) =>
let
AddParsedNameColumn = Table.AddColumn(parTable, "Name Trimmed", each if [Name To Parse] = null then "" else fnParseName([Name To Parse]), type text),
RemoveOldColumn = Table.RenameColumns(Table.RemoveColumns(AddParsedNameColumn, {"Name To Parse"}),{{"Name Trimmed", parNewColumnName}})
in
RemoveOldColumn,
There is a column in the table (called "Name To Parse") in the original table that is created by renaming a column to ensure the function to pick the right one. How can I pass the name of that column as a parameter and then (more importantly) how can I use it in the statements above?
Any help is greatly appreciated.
Wilko
Why not just pass the entire column in versus the name using something like Table.SelectColumns? Or I may be missing something.
Thanks for the suggestion. I tried that but didn't succeed in getting the syntax right. What is the type that is passed to the function? How do I refer to it in the function?
If you have some hints or code snippets as examples....
Regards,
Wilko
Hi,
Something I have a workaround for but not happy with it is when I try to use custom function in Power BI and whant the name of the column as a parameter. In the example below:
fnParseColumn = (parTable as table, parNewColumnName as text) =>
let
AddParsedNameColumn = Table.AddColumn(parTable, "Name Trimmed", each if [Name To Parse] = null then "" else fnParseName([Name To Parse]), type text),
RemoveOldColumn = Table.RenameColumns(Table.RemoveColumns(AddParsedNameColumn, {"Name To Parse"}),{{"Name Trimmed", parNewColumnName}})
in
RemoveOldColumn,
There is a column in the table (called "Name To Parse") in the original table that is created by renaming a column to ensure the function to pick the right one. How can I pass the name of that column as a parameter and then (more importantly) how can I use it in the statements above?
Any help is greatly appreciated.
Wilko
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 76 | |
| 37 | |
| 31 | |
| 27 | |
| 27 |