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 August 31st. Request your voucher.

Reply
Sadia-A
New Member

Add Column to calculate running profit for each row from profit column

Hi

I am in learning stage of Power BI. I came across a problem. I have a table with 2 column namely: Entry_date and profit. I want to add a Cumm Profit2 column which can calculate running total profit for each row except for the 1st row as it will remain the same. If you refer to the picture the Cumm Profit2 is not matching Cumm Profit. Kindly point out the Mistake.

problem.png

1 ACCEPTED SOLUTION
yasharma221195
Frequent Visitor

Hello,

Make sure you first understand the concept of row and filter context first,

 

Here replace sales column to "Profit" column, sheet1 with your table name and date with "Entry date"

 

Cumulative Sum  =
SUMX(
    FILTER(
        ALL(Sheet1),
        Sheet1[Date] <= EARLIER(Sheet1[Date])
    ),
    Sheet1[Sales]
)

Logic - I want to have filtered table in such a way that it will give rows older dates than the selected date row  and do the sum for that filtered table.

View solution in original post

3 REPLIES 3
yasharma221195
Frequent Visitor

Hello,

Make sure you first understand the concept of row and filter context first,

 

Here replace sales column to "Profit" column, sheet1 with your table name and date with "Entry date"

 

Cumulative Sum  =
SUMX(
    FILTER(
        ALL(Sheet1),
        Sheet1[Date] <= EARLIER(Sheet1[Date])
    ),
    Sheet1[Sales]
)

Logic - I want to have filtered table in such a way that it will give rows older dates than the selected date row  and do the sum for that filtered table.

Thank you for help

Rupak_bi
Super User
Super User

try to modify the formula with below

1.     filter(all(table)
2.      "MIN" to be replaced to "Max". 



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.