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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
kkaushi4
Frequent Visitor

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 @kkaushi4 ,

 

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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