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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Calculating Remaining Value

New to Power BI so this may be either simple or not possible. But looking for suggestions.

 

I have two tables

Table 1

IDSpent
A100
B80
C30

 

Table 2

IDDateRecieved
A12/575
A12/430
B12/3100
A12/120
C11/2010

 

 

I would like to add a column to table 2 that would be the amount of recieved money remaining (recieved - spent). If the value is negative, it would carry over to the more recent row. If there is no more recent row and the value is negative show the negative value. If there is no spent money then just subtract 0.

 

So the table would be something like this.

IDDateRecievedReamining
A12/575( -50 carry over from 12/4 + 75) = 25
A12/430( -80 carry over from 12/1 + 30) = -50 but show as 0
B12/3100(80-100) = 20
A12/120(20-100) = -80 but show as 0
C11/2010(10-30) = -20 show as -20 because no more recent entries

 

This is more complicated than I can google to figure out on my own.

 

Thanks in advance.

 

2 REPLIES 2
amitchandak
Super User
Super User

Take the cumulative of table 2 and then try the diff

CALCULATE(sum(table2[received]),filter(table2,table2[received]<=max(table2[ Date])))

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak 

 

I am not sure that is what I am looking for. Maybe this is what you are suggesting, but what I am thinking now is

Create a column in table 2 that is the total receieved to date. That being a matching ID and date <= date of the row. Then I can take the difference from table 1.

 

Can you help with creating that new column sums the recieved of rows with matching the IDs and has a date <= date of the row?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors