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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
gulzatsirenova
Regular Visitor

Calculation based on previous value in calculated coloumn/advanced recursive calc

Hello, gurus!

 

I am trying to calculate "Total quality", based on combination of previous rows including the calculated column itself:

 

i:  Mass:   Quality:   **bleep** Mass:  Total quality

1) 100       1             100             100*1/100=1

2) 50         2             150             (100*1+50*2)/150=1.33

3) 50         3              200            (150*1.33+50*3)/200=1.75

4) -100                     100            1.75

5) 80        2               180            (1.75*100+80*2)/180=1.86

Basically: 

Total quality (i)= if positive, then [**bleep** mass (i-1)*Quality (i-1)+Mass(i)*Quality(i)]/**bleep** Mass(i); if negative, then Total quality (i-1).

 

I went to through some articles, and seems like handling recursive calcuation is not straightforward in DAX. But I thought I would give it a try, and maybe there is some workaround. Any workaround helps (either through calculated column, or measure, or power query).

 

Thanks in advance! 

 

 

1 REPLY 1
v-xicai
Community Support
Community Support

Hi @gulzatsirenova ,

 

You may refer to the links:

 

Recursive Functions in Power BI / Power Query

 

Recursive Calculations in PowerPivot using DAX

 

Best Regards,

Amy

 

Community Support Team _ Amy

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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