DAX: Model-Dependent vs Independent UDFs
Power BI
Nov 20, 2025 3:00 AM

DAX: Model-Dependent vs Independent UDFs

Master DAX model dependent versus model independent functions, eliminate hidden dependencies, streamline Power BI models

Key insights

  • User-defined functions (UDFs) in DAX)
    Microsoft added first-class UDF support so you can define reusable, parameterized DAX functions using the FUNCTION keyword.
    Functions accept typed parameters, can include documentation comments (///), and act like built-in DAX functions inside supported tools.
  • Model-dependent vs model-independent
    Model-dependent functions reference model objects (tables, columns, measures) directly and are tied to a single semantic model.
    Model-independent functions take all needed tables and columns as parameters, making them portable across models and more resilient to model changes.
  • Avoiding hidden dependencies
    Prevent breakage by making dependencies explicit: pass table/column references as parameters instead of referencing them inside the function.
    Validate functions after model changes and document expected inputs to reduce surprises.
  • Naming conventions & documentation
    Use clear, consistent names and prefixes that indicate scope (for example, shared_ or local_) to help other authors discover and understand functions.
    Include /// documentation comments so IntelliSense shows intent, parameter meanings, and examples.
  • Authoring locations & testing
    Author and test functions in DAX Query View for quick iteration, script them in TMDL for model versioning, and organize them in Model Explorer under a Functions node.
    Write small test queries that cover edge cases and parameter combinations before widespread reuse.
  • Maintenance and reuse benefits
    UDFs improve consistency by centralizing logic—update one function and all callers inherit the change, reducing duplication and bugs.
    Combine model-independent libraries for cross-project reuse, and keep lightweight model-dependent wrappers to simplify model-specific usage.

Overview: SQLBI’s explainer on a major DAX upgrade

In a recent YouTube video, the analytics team at SQLBI examined Microsoft’s rollout of user-defined functions in DAX, a change introduced in the September 2025 updates to Power BI Desktop and other DAX-supporting tools. The piece walks viewers through the new FUNCTION syntax, how functions are authored, and where they appear in the model metadata. Moreover, the presenters highlight practical consequences for model design, portability, and team collaboration. Consequently, the video serves both as a tutorial and as a conversation starter about evolving best practices.

What are DAX user-defined functions and where they live

The video clarifies that UDFs in DAX are first-class model objects: named, typed, and callable across the semantic model. For example, authors can create functions using a new FUNCTION declaration that accepts typed parameters, includes inline documentation, and returns scalar or table results. Additionally, SQLBI shows that functions can be authored in different model surfaces such as the Query view, authored as model metadata, and organized in a dedicated Functions node to improve discoverability. As a result, these objects change how modelers package reusable logic, moving it from ad-hoc measures into managed artifacts.

Model-dependent versus model-independent: key distinctions

Central to the video is the distinction between model-dependent and model-independent functions, which affects portability and robustness. Model-dependent functions reference columns, tables, or measures directly and thus offer concise calls inside a single semantic model, but they can break if underlying objects are renamed or removed. By contrast, model-independent functions accept all needed references as parameters, making them portable across models but often more verbose to call because they require explicit context. Therefore, the choice between the two approaches involves a tradeoff between convenience within a model and long-term reusability across models.

Tradeoffs and practical challenges highlighted in the video

While SQLBI praises the clarity and reuse benefits of functions, they also point out concrete tradeoffs that practitioners must weigh. For example, model-independent libraries enable sharing logic across teams and projects, yet they shift the burden to clear parameter naming and careful orchestration of table and column references. Conversely, model-dependent functions are simpler to author for a single model, but they embed hidden dependencies that complicate refactoring and versioning. Thus, the video recommends explicit naming conventions and documentation to reduce risk, especially in collaborative environments.

Best practices and recommendations

To mitigate hidden dependencies, the presenters recommend several practical steps including consistent naming, inline documentation, and conservative use of model-dependent references. They also advise keeping the function surface minimal and designing model-independent wrappers where appropriate so that a portable core can be exposed through simpler model-bound calls. Furthermore, the video stresses testing functions in isolation and using type hints to catch mismatches early, which improves maintainability and reduces surprise failures. Accordingly, teams should build governance practices around function libraries just as they do for measures and tables.

Implications for Power BI practitioners and next steps

Finally, the video explores what these changes mean for typical Power BI and semantic model workflows, noting both opportunities and work required to adapt. On one hand, functions support cleaner, more modular models and the possibility of shared DAX libraries that raise quality across projects. On the other hand, teams must invest time to adopt consistent conventions and to decide which functions should be portable versus model-scoped. Overall, SQLBI frames the update as a significant step forward while cautioning that sensible governance and thoughtful design will determine whether organizations fully realize the benefits.

Power BI - DAX: Model-Dependent vs Independent UDFs

Keywords

Model dependent DAX functions, Model independent DAX functions, DAX user defined functions, Power BI DAX UDFs, Tabular model user defined functions, Reusable DAX patterns, DAX measures vs calculated columns, Optimize DAX user defined functions