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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Add current value to previous row value (with condition)

Hello everyone,

 

Is there any way that I can do this in Power BI? I want to make column "calculations" using this formula.

Screenshot_1.png

 

 

Thank you in advance,

Milena

1 ACCEPTED SOLUTION
saraMissBI
Resolver I
Resolver I

Hi @Anonymous ,

Here is a solution to your problem. I am not sure if it is the most efficient solution, but it gives you the result needed.

First, I added an index column from the query editor to the table to be able to catch the previous value of Type and Size. Then, I added a calculated column with the formula below:

formula.png
Please find the .pbix file here
(N.B. I updated the file please make sure you refresh the page to get the correct file!)
Please if that solves your problem, accept as solution and give kudos 🙂 
Thank you!

View solution in original post

2 REPLIES 2
saraMissBI
Resolver I
Resolver I

Hi @Anonymous ,

Here is a solution to your problem. I am not sure if it is the most efficient solution, but it gives you the result needed.

First, I added an index column from the query editor to the table to be able to catch the previous value of Type and Size. Then, I added a calculated column with the formula below:

formula.png
Please find the .pbix file here
(N.B. I updated the file please make sure you refresh the page to get the correct file!)
Please if that solves your problem, accept as solution and give kudos 🙂 
Thank you!
Anonymous
Not applicable

Hi @saraMissBI ,

 

Thank you so much, this works!

 

I have one additional queston, what should I do if I want to subtract values from column "Number"?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors