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

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

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.