Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

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 1
v-rzhou-msft
Community Support
Community Support

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.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!