Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Update Data in Power BI Based on Previous rows, using Measures

Hi,

I have data like this:

MonthsSupplyBOHDemandEOH
150100.0050.00100.00
260   
370   
480   
590   
6100   
7110   
8120   
9130   
10140   
11150   
12160   

And I want it make it like: (using Measure in Power BI):

 

MonthsSupplyBOHDemandEOH
150100.0050.00100.00
260100.0050.00110.00
370110.0055.00125.00
480125.0062.50142.50
590142.5071.25161.25
6100161.2580.63180.63
7110180.6390.31200.31
8120200.31100.16220.16
9130220.16110.08240.08
10140240.08120.04260.04
11150260.04130.02280.02
12160280.02140.01300.01

 

Where BOH= EOH of previous month,

Demand=BOH/2

EOH= Supply+ BOH- Demand

 

1 Reply

  • Anonymous's avatar
    Anonymous
    Not 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 Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.