udf
2 TopicsWould you like to know a secret way to delete your DAX UDF code?
🧠 Imagine you've written a brilliant DAX UDF in model view. Finally you decide to add a comment, and suddenly the whole function disappears. 'Undo' is not working. 🚨This happened to me a few days ago. It was my fault for trying to add a comment with "//" above the function header. However, I hadn't expected this to delete the entire function. 💡As I discovered, the problem isn't the comment itself, but characters that aren't allowed in a function name. After(!) deleting the function Power BI displayed a warning : "Special characters are not allowed in a function name..." That put me on the right track. Step-by-step guide to follow: ➡️ Write a DAX UDF in the model view (don't spend to much time on it, as your work will get lost) ➡️ Go to the top of the file ➡️ Press Shift-Enter ➡️ Go back to the top ➡️ Type "// Comment" or any other character that is not allowed in a function name ➡️ Press Enter to save your function ➡️ Is your function still there? ➡️ If not, check wether undoing (Ctrl-Z) works ❓ Is this a bug or a hidden feature? If it is a feature what is it good for? To permanentely delete my work? 🤔 ✒️ I look forward to your comments!557Views6likes2CommentsDAXUDF Reference a column
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)Solved1.2KViews1like3Comments