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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
lesnalder
Frequent Visitor

Cumulative cashflow actual and forecast

I'm having a problen writing the DAX to get a running total. It's OK until I bring in the Revenue Type column.  The Actual and Forecast Monthly Revenue figures come from two different tables. I've created measures and added them together to give the Monthly Revenue.

The tables are linked to a date dimension table and a Revenue Type table.

This is what I want

Financial YearRevenue type Monthly RevenueRunning total
2020-21ActualApr1,0001,000
 ForecastMay1,0002,000
  Jun1,0003,000
  Jul1,0004,000
  Aug1,0005,000
  Sep1,0006,000
  Oct1,0007,000
  Nov1,0008,000
  Dec1,0009,000
  Jan1,00010,000
  Feb1,00011,000
  Mar1,00012,000
2021-22ForecastApr1,0001,000
  May1,0002,000
  Jun1,0003,000
  Jul1,0004,000

 

And this is what I'm getting

   Monthly RevenueRunning total
2020-21ActualApr1,0001,000
  May 1,000
  Jun 1,000
  Jul 1,000
  Aug 1,000
  Sep 1,000
  Oct 1,000
  Nov 1,000
  Dec 1,000
  Jan 1,000
  Feb 1,000
  Mar 1,000
 ForecastMay1,0002,000
  Jun1,0003,000
  Jul1,0004,000
  Aug1,0005,000
  Sep1,0006,000
  Oct1,0007,000
  Nov1,0008,000
  Dec1,0009,000
  Jan1,00010,000
  Feb1,00011,000
  Mar1,00012,000
2021-22ForecastApr1,0001,000
  May1,0002,000
  Jun1,0003,000
  Jul1,0004,000

 

My current DAX measure is calculate([Cashflow],DATESYTD('Calendar'[Date],"31/3"))

 

I'd appreciate some assistance.

1 ACCEPTED SOLUTION

Thank you for your suggestion but it didn't give me what I wanted. however in the meantime i hve used a workaround. I am nuw providing the Actual and forecast values as different series, instead of having the Revenue Type identified in the row headings and I ahve used the original cumulative measure I created

View solution in original post

4 REPLIES 4
stevedep
Memorable Member
Memorable Member

You can try this approach:

Sales RT :=
VAR MaxDate = MAX ( 'Date'[Date] ) -- Saves the last visible date
RETURN
CALCULATE (
[Sales Amount], -- Computes sales amount
'Date'[Date] <= MaxDate, -- Where date is before the last visible date
ALL ( Date ) -- Removes any other filters from Date
)

 

As described here:

https://www.sqlbi.com/articles/computing-running-totals-in-dax/

Thank you for your suggestion but it didn't give me what I wanted. however in the meantime i hve used a workaround. I am nuw providing the Actual and forecast values as different series, instead of having the Revenue Type identified in the row headings and I ahve used the original cumulative measure I created

stevedep
Memorable Member
Memorable Member

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.