Forum Discussion
Anonymous
4 years agoNot applicable
Update Data in Power BI Based on Previous rows, using Measures
Hi,
I have data like this:
| Months | Supply | BOH | Demand | EOH |
| 1 | 50 | 100.00 | 50.00 | 100.00 |
| 2 | 60 | |||
| 3 | 70 | |||
| 4 | 80 | |||
| 5 | 90 | |||
| 6 | 100 | |||
| 7 | 110 | |||
| 8 | 120 | |||
| 9 | 130 | |||
| 10 | 140 | |||
| 11 | 150 | |||
| 12 | 160 |
And I want it make it like: (using Measure in Power BI):
| Months | Supply | BOH | Demand | EOH |
| 1 | 50 | 100.00 | 50.00 | 100.00 |
| 2 | 60 | 100.00 | 50.00 | 110.00 |
| 3 | 70 | 110.00 | 55.00 | 125.00 |
| 4 | 80 | 125.00 | 62.50 | 142.50 |
| 5 | 90 | 142.50 | 71.25 | 161.25 |
| 6 | 100 | 161.25 | 80.63 | 180.63 |
| 7 | 110 | 180.63 | 90.31 | 200.31 |
| 8 | 120 | 200.31 | 100.16 | 220.16 |
| 9 | 130 | 220.16 | 110.08 | 240.08 |
| 10 | 140 | 240.08 | 120.04 | 260.04 |
| 11 | 150 | 260.04 | 130.02 | 280.02 |
| 12 | 160 | 280.02 | 140.01 | 300.01 |
Where BOH= EOH of previous month,
Demand=BOH/2
EOH= Supply+ BOH- Demand
1 Reply
- AnonymousNot applicable
Hi Anonymous ,
As your calculate logic, you will use the previous result in current row. This seems like iteration. I think Dax doesn't support us to calculate in iteration logic. I suggest you to achieve your goal by Power Query.
For reference:
List.Generate() and Looping in PowerQuery
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.