Feature Request: Native support for iterative/recursive calculations in DAX
Description
I propose the introduction of a native DAX function or a set of functions designed to handle sequential or iterative calculations, where the result of one step is the input for the next. This is a fundamental capability in most programming languages and is crucial for a growing number of common business modeling scenarios.
Problem Statement
A frequent and challenging use case in Power BI is the calculation of running balances that depend on conditional logic, such as a daily inventory level that cannot fall below zero (New_Balance = MAX(0, Prior_Balance + Daily_Change)).
Currently, achieving this in DAX is exceptionally difficult:
Standard DAX is insufficient: A simple running total using CALCULATE fails because it cannot handle the state-dependent logic (e.g., the "reset to zero" condition).
Advanced DAX patterns are prohibitive: The workarounds require extremely complex, non-intuitive, and error-prone patterns using multiple nested variables, iterators, and virtual tables. These patterns are a significant barrier to all but the most expert DAX developers and are difficult to maintain and debug.
Power Query is not always applicable: While Power Query can handle this, it is a pre-load transformation. It cannot be used if the base data is generated dynamically within the DAX model itself (e.g., a calculated table based on user selections).
Proposed Solution
Introduce a native DAX function that simplifies this logic. Conceptually, it could work like this:
ITERATE(<table>, <initial_value>, <result_expression> [, <sort_order>])
Where <result_expression> could reference the value from the previous step, abstracting away the complexity. For the inventory example, the expression could be as simple as MAX(0, [PreviousStepValue] + [Daily_Change]).
Value Proposition
Simplification: It would replace dozens of lines of complex DAX with a single, readable function, dramatically lowering the barrier for entry.
Accuracy & Reliability: It would eliminate the logical flaws and edge-case failures present in many widely-circulated advanced DAX workarounds.
Performance: A native, optimized function would likely outperform the current complex virtual-table-based patterns.
Modernization: It aligns DAX with the capabilities of modern data analysis and programming languages, acknowledging that sequential business logic is an increasingly common requirement.
This feature would significantly enhance the analytical power of DAX, making it more intuitive and robust for a critical class of business problems. I strongly urge the Power BI team to consider this for a future release.
Recent ideas
Data Pipelines - Run only selected activities
For debugging and testing pipeline activities during development, allow us to select one or multiple activities and run only the selected pipeline activities. For example, I'm working on editing ...frithjof_v1 day agoCommunity ChampionNew619Views11likes2CommentsSemantic model connection bindings should be in source control (Git)
Semantic model data source connection bindings should be source controlled. A semantic model can contain multiple data source references, each of which can be mapped to a separate Fabric data connec...frithjof_v1 day agoCommunity ChampionNew21Views1like0CommentsBulk changing column names in Visualizations Pane
We often use raw/api column names or measures with a set nomenclature to be consistent and to keep track of them but we do not want to display these names in the visuals. Currently we have to change ...vishal1401971 day agoFrequent VisitorNew6Views0likes0Comments