Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
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
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 Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |