gregszkilnyk
New Member
- Joined
- Dec 20, 2021
- Messages
- 2
- Office Version
- 2016
- Platform
- Windows
Hello,
I am trying to create a column in PowerBI that takes the cumulative sum of a table column of numbers, *but*, if in any row the value of that sum is exceeded by a number in a secondary column, the cumulation is replaced with that secondary number. The cumulative sum would then carry on for following rows. Basically, I am trying to recreate the Excel logic shown below in Power Query or a DAX calculated column.
Given that you cannot seem to self-reference columns in PQ or DAX, this seems challenging to replicate. Am I missing a function (I'm relatively new to PQ and DAX)? Are there any common workarounds for this?
Thanks,
I am trying to create a column in PowerBI that takes the cumulative sum of a table column of numbers, *but*, if in any row the value of that sum is exceeded by a number in a secondary column, the cumulation is replaced with that secondary number. The cumulative sum would then carry on for following rows. Basically, I am trying to recreate the Excel logic shown below in Power Query or a DAX calculated column.
Given that you cannot seem to self-reference columns in PQ or DAX, this seems challenging to replicate. Am I missing a function (I'm relatively new to PQ and DAX)? Are there any common workarounds for this?
Thanks,