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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Re: Previous Row Value for First Line

Hi, 
 
I need help with the following. Currently, the first line of my output for 'New Column' is not the result I wanted. First line should be 'Current Balance' (-335.00) - 'Amount' (-235.00). How do I add this in my current script?
 
Current Script:
New Column =
VAR PreviousRow =
TOPN (
1,
FILTER ( Table, Table[Date ] < EARLIER ( Table[Date ] ) ), [Date ], ASC)
VAR PreviousValue =
MINX ( PreviousRow, Table[ Amount] )
RETURN
Table[ Amount] + PreviousValue

 

Current Output:

CustomerNoTypeDate       AmountCurrent BalanceNew Column
BI1112300000008Customer Payment4/2/2019-235.00-335.00-235.00
BI1111200000019SD-Billing Document4/6/2019251.00 -351.00
BI1111200000030SD-Billing Document4/12/2019203.00 -554.00
BI1111200000051SD-Billing Document4/20/201993.00 -647.00
BI1112300000040Customer Payment4/24/2019-279.00 -368.00
BI1112300000041Customer Payment4/24/2019-504.00 136.00
BI1111200000076SD-Billing Document4/26/201976.00 60.00
BI1112300000087Customer Credit4/30/2019-10.00 70.00
BI1112300000088Customer Credit4/30/2019-17.00 87.00

 

 

Desired Output:

CustomerNoTypeDate       AmountCurrent BalanceNew Column
BI1112300000008Customer Payment4/2/2019-235.00-335.00-100.00
BI1111200000019SD-Billing Document4/6/2019251.00 -351.00
BI1111200000030SD-Billing Document4/12/2019203.00 -554.00
BI1111200000051SD-Billing Document4/20/201993.00 -647.00
BI1112300000040Customer Payment4/24/2019-279.00 -368.00
BI1112300000041Customer Payment4/24/2019-504.00 136.00
BI1111200000076SD-Billing Document4/26/201976.00 60.00
BI1112300000087Customer Credit4/30/2019-10.00 70.00
BI1112300000088Customer Credit4/30/2019-17.00 87.00

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , refer if the file attached after signature can help.

 

Created two-column. Check those

 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , refer if the file attached after signature can help.

 

Created two-column. Check those

 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors