Forum Discussion
DAX UDFs / Shared Semantic Model
- 9 months ago
bhalicki In my testing, UDF's do not work like measures in that they are not available when Live connected to the model. I have tested this and I cannot seem to see any defined UDF functions in the Live connected semantic model. I do not have any kind of local model either.
Hi bhalicki,
To be Clear when you have shared semantic model (with your UDF) and Local model in your report file (The report only sees the local model's functions not the shared model's UDFs).
To Fix This:
- Use ONLY Live Connection to the shared semantic model
Remove any local tables/data from your report
- Connect directly to the published semantic model
To Check it:
- Open your report in Power BI Desktop
Go to Model view
- If you see any local tables (delete them)
- Ensure you are connected via Live Connection to your shared semantic model
Finally once you are using a pure Live Connection you will see the UDF from your shared model and can use it in measures
Th Short answer is that is no need to publish UDFs in local models (that defeats the whole purpose of shared semantics)
I hope this was helpful ☺️❤️
Ahmed-Elfeel I have tested this and, unfortunately, have to disagree. I have setup UDFs in a semantic model, published the model, created a new blank report, connected Live to the the published model and I do not see the UDFs in the original model.
- Ahmed-Elfeel9 months agoSuper User
Hi GeraldGEmerick,
Are you sure that UDFs is in your report?
- First you should verify UDF is actually in your model:
- Open semantic model → Model view → Check Model explorer for "Functions" folder
- If not there you did not save it to the model properly
- Try using UDF manually (even if invisible):
-- Type this exactly do not wait for IntelliSense Test Measure = YourUDFName([Measure1], [Measure2])Check preview features:
Both model AND report Power BI need DAX UDFs preview enabled
Restart after enabling
Also here is some resources you can check:
- GeraldGEmerick9 months agoSuper User
Ahmed-Elfeel The UDF is in the report. Connected Live, the UDF functions do not show up in DAX Query View. Also, Intellisense does not "see" the functions. This is all in Power BI Desktop. That said, the UDFs are apparently useable but not sure how anyone would know that.
- First you should verify UDF is actually in your model: