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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
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! Prices go up Feb. 11th.

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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