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.
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.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |