Forum Discussion
UDF with variable table reference and fixed column reference
- 8 months ago
Hi Brenda_Loznik,
this is a known DAX limitation and expected behavior, While you can pass a table as a parameter to a DAX user-defined function, DAX does not allow referencing columns with table-qualified notation (Table[Column]) inside the function when the table is coming from a parameter.
To make it work, you first need to rebuild the column names inside the function using SELECTCOLUMNS, and then you can use them normally.
Thanks,
Prashanth - 8 months ago
Hi Brenda_Loznik,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by community members for your issue worked for you or let us know if you need any further assistance?
Your feedback is important to us, Looking forward to your response
Thanks,
Prashanth
- 5 months ago
In case anyone else runs into the same issue, After the february 2026 update I now have a working solution:
function my_function =(InputTable : ANYREF EXPR) =>var TableName = TABLEOF ( InputTable)RETURN
-- Here you can put the logic that you want to repeat for every InputTable --
Hi Brenda_Loznik,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by community members for your issue worked for you or let us know if you need any further assistance?
Your feedback is important to us, Looking forward to your response
Thanks,
Prashanth