Forum Discussion
UDF (User Defined Functions) in semantic model in Fabric?
- 10 months ago
Hi Steeks91 ,
To my test this works correctly in the Direct Lake mode, in my case it asked me to do an updagrade of the compatability level of the semantic model but implemented the new logic.
It's still on preview but it's usable. How are you creating the function using the TMDL script or the DAX editor?
To generate the function you need to do it on the TMDL script, I have seen some problems using the DAX editor.
My general code is:
createOrReplace /// Optional description above the function function Test = ( a: expr, b: int64 ) => a+b
Amazing - you're a genius! Thank you very much!
I was using DAX editor.
When using TMDL I just got this message, but after accepting it worked. When editing in desktop mode it works. However, when looking at the semantic model in the browser I don't see "funtions". I don't mind but just a FYI if someone else sees this.
Thanks MFelix !!
Hi Steeks91 ,
This feature is still under developement so it does not show in the service that is correct and even more if you add a measure with that UDF it will return error:
However it works properly and you can use it to add measures to your semantic model, just be aware that since you are in Direct Lake mode the use of UDF need to be done at semantic model level you cannot use it in Report Measures.