Join 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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi,
I am trying to add metadata when calling AddColumn function.
The new column is a function type and its body will be empty (just a reference). It works fine with this command:
FunctionColumnAddedTable = Table.AddColumn(Source, "FunctionColumn", each (InputColumn1 as text) as any => ...)
I want to add meta to this function such as:
FunctionColumnAddedTable = Table.AddColumn(Source, "FunctionColumn", each (InputColumn1 as text) as any => ... meta [Description = "Desc"])
But when I try to get the metada, I see it is empty:
MetadataColumn = Table.AddColumn(FunctionColumnAddedTable , "MetadataColumn", each Value.Metadata([FunctionColumn]))
Any idea about my mistake?
Solved! Go to Solution.
Hi @ImkeF ,
"That's metadata in the result of a function." helped me to try enclosing the function definition between paranthesis to add metadata to the function body. And it worked by doing:
FunctionColumnAddedTable = Table.AddColumn(Source, "FunctionColumn", each ((InputColumn1 as text) as any => ...) meta [Description = "Desc"])
Thank you very much for your help
Hi @necmik ,
this is what that query returns for me:
But now I see what you are after. That's metadata in the result of a function.
It would work like so:
() =>
Table.FromRecords(
{
[noMetadataHere = 1,
WithMetadataOfTheInvokedFunction = 2 meta [InvokedMetadata = "Some metadata here"]
]
}
)
Please also check the file enclosed.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @ImkeF ,
"That's metadata in the result of a function." helped me to try enclosing the function definition between paranthesis to add metadata to the function body. And it worked by doing:
FunctionColumnAddedTable = Table.AddColumn(Source, "FunctionColumn", each ((InputColumn1 as text) as any => ...) meta [Description = "Desc"])
Thank you very much for your help
Hi @necmik ,
not sure I fully get it, but you might have created a nested function. Try omitting the each syntax sugar like so:
FunctionColumnAddedTable = Table.AddColumn(Source, "FunctionColumn", (InputColumn1 as text) as any => ... meta [Description = "Desc"])
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @ImkeF ,
Thank you for your answer. I have already tried it but it didn't work. What I am trying to do is creating a function similar to AIFunctions.Contents(). Its data column basically includes a function reference and metadata related to the this reference. You can check it by runing M query below. You can see that some functions have metadata (such as Cognitive Services ones):
let
MetadataColumn = Table.AddColumn(AIFunctions.Contents(), "MetadataColumn", each Value.Metadata([Data]))
in
MetadataColumn
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 12 | |
| 11 | |
| 7 | |
| 7 | |
| 6 |