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!View all the Fabric Data Days sessions on demand. View schedule
So, i want to make a DAX UDF that takes a (one-column) table as input and outputs a concatenation of all distinct values.
Something like:
DEFINE FUNCTION
ConcValues = (column: Table) => CONCATENATEX( DISTINCT(column), ???columnName???, ", ")
Since i can pass any table, the column name is variable and cannot be hard-coded in the UDF.
Any ideas how to implement this? How to make a reference to a column name? Or how to reference the column of a table by a number, i.e. the 2nd column of the table or the first column, etc)
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file, and please try something like below.
@Jihwan_Kim that works! I could have sworn that i had tried anyref but i must have messed somewhere else - my actual measure is a bit more complex that the simplified version i posted here. Anyway, problem solved, thanks mate!
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file, and please try something like below.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 16 | |
| 11 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 22 | |
| 20 | |
| 17 | |
| 12 |