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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
chris_rowley
Frequent Visitor

Running Total using a base value from another table

So i have a table (1) currenlty with columns calculating runnings totals,

 

Booked_Running Total = calculate(
sum(All_Data[BOOKED]),
all(All_Data),
All_Data[DATE] <= EARLIER(All_Data[DATE]))

 

I then have another table (2) with 1 row that contains base values. Eseentially i would like to create 2 brand new calculated columns in table (1) that uses the base value in table (2) and performs a running total for each day adding the booked field each day to the base value

table (1)

DATAAll_ValuesCategoryCat_RefDATEBOOKEDCREATEDREBOOKEDYearWeek_CommencingBooked_Running TotalRebooked Running TotalBooked (ex.Rebooked)MONTH
1393 | 2020-08-16 00:00:00 | TRIAGE_OUTCOME_RECORDED1,393TRIAGE_OUTCOME_RECORDED4416-Aug-20000202010-Aug-2070,958,48911,338,20059,620,289August
1 | 2020-08-16 00:00:00 | PATIENT_LOCK_REMOVED1PATIENT_LOCK_REMOVED3116-Aug-20000202010-Aug-2070,958,48911,338,20059,620,289August
46 | 2020-08-16 00:00:00 | ASSESSMENT_COMPLETED46ASSESSMENT_COMPLETED2016-Aug-20000202010-Aug-2070,958,48911,338,20059,620,289August
93 | 2020-08-16 00:00:00 | ASSESSMENT_RECORDED93ASSESSMENT_RECORDED2216-Aug-20000202010-Aug-2070,958,48911,338,20059,620,289August

 

Table (2)

Cumulative Bookings (inc. Rebookings)Cumulative Bookings (ex.. Rebookings)Date
71,359,62562,643,54214 June 2015

 

i have googled and googled and i cannot find any solutions that work. hope this makes sense.

 

2 ACCEPTED SOLUTIONS

hi  @chris_rowley 

Use this formula

Booked_Running Total = calculate(
sum(All_Data[Bookings]),
FILTER(all(All_Data),
All_Data[Date of Booking / Referral] <= EARLIER(All_Data[Date of Booking / Referral])))+SUM('Table(2)'[Overall_Total])

and why it doesn't answer your issue

4.JPG

 

please share your sample pbix file and your expected output.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@v-lili6-msft  that solution worked perfectly much appreciated thank you.

View solution in original post

6 REPLIES 6
chris_rowley
Frequent Visitor

hi all thank you for the assitance, unfortunatly the solutions provided didnt answer my issue which is partly my fault. Ill explain the issue a little better. in 2015 a software solution had been updated and as a result of this the data behind had changed it structure. however the figures pre the software change need to be kept hold off and one of the requirements from the data is to have a runing total per day.

 

here is the much simpler table (1)

Date of Booking / ReferralBookings
15/06/1520,167
16/06/1524,560
17/06/1513,298
18/06/1545,362
19/06/1539,242
20/06/154,211
21/06/151,747
22/06/1544,703

 

Table (2) - this containts the previous running total and is needed for a base value

Overall_TotalDate
71,359,62514-Jun-15

 

so essentially the calculation needs to be table (1)[bookings] + table (2)[Overall_Total] then provide a running total per day 

 

expected result table (1)

Date of Booking / ReferralBookingsRunning_Total_bookings_Per_day
15/06/1520,16771,379,792
16/06/1524,56071,404,352
17/06/1513,29871,417,650
18/06/1545,36271,463,012
19/06/1539,24271,502,254
20/06/154,21171,506,465
21/06/151,74771,508,212
22/06/1544,70371,552,915

 

hopefully this clears everything up

hi  @chris_rowley 

Use this formula

Booked_Running Total = calculate(
sum(All_Data[Bookings]),
FILTER(all(All_Data),
All_Data[Date of Booking / Referral] <= EARLIER(All_Data[Date of Booking / Referral])))+SUM('Table(2)'[Overall_Total])

and why it doesn't answer your issue

4.JPG

 

please share your sample pbix file and your expected output.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-lili6-msft  that solution worked perfectly much appreciated thank you.

v-lili6-msft
Community Support
Community Support

hi  @chris_rowley 

If just create column as below in table(1)?

New column 1=SUM('Table(2)'[Cumulative Bookings (inc. Rebookings) ])+'Table(1)'[Booked_Running Total]

 

New column 2=SUM('Table(2)'[Cumulative Bookings (ex.. Rebookings) ])+'Table(1)'[Booked (ex.Rebooked)]

 

If not your case, please share your logic and expected output.

Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@chris_rowley , try this as column


Booked_Running Total = calculate(
sum(All_Data[BOOKED]),
filter(All_Data,
All_Data[DATE] <= EARLIER(All_Data[DATE])))

 

And this as a measure

 

Booked_Running Total = calculate(
sum(All_Data[BOOKED]),
filter(all(All_Data),
All_Data[DATE] <= max(All_Data[DATE])))

 

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
parry2k
Super User
Super User

@chris_rowley very hard to make sense out of your data table, can you paste the table with fewer columns and make sure these are not overlapping and merged together and also share what is your expected output.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.