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
DataSheet
New Member

Running total across table with multiple dates in one chart with filtering

Hello,

 

I am desperate for help with my case. Iam new in powerBi (screens from excel but please imagine it is powerBI), and Iam facing a problem such that:


I have a "General" table, with 4 columns of which 3 are differnet dates, for each phase of a project (Phase1. Phase2, Phase3). 4th column represents cost.

I need to create an "area" type chart, which will be showing running total of costs based on dates from phase 1, which will be filtered by "between" type slicer. In the same chart, I need to show running total of the costs relevant to dates filtered from phase 1, but I need to see how they were distributed based on dates from phase2. At last, I need to see, how the costs from phase 1 were distributed but based on Phase 3 dates.

 

To visualise this:

let's say I need to filter only year 2021 from Phase1 column, and then show running total of costs based on these filtered dates. Then, I need to show the very same costs, but their running total "distribution" based on Phase2 dates but still respecting that I have filtered only costs from Phase1 in year 2021? The same with Phase 3.

 

 

Chart Iam trying to create:

 

DataSheet_0-1683135312897.png

"genereal" table

DataSheet_1-1683136021460.png

 

Another visualisation:

DataSheet_2-1683136751894.png

 

 

So far, I came across solutions using independent "calendar" table, which is then connected via relationships to dates in Phase1,2,3. Using function USERELATIONSHIP, I should be able to use Calendar as X axis and lay running totals of Phase1,2,3 on this axis, But I can not get the code working. Could you please help me?

 

BONUS question: Is there a way to add another "stacked" area, showing running total for Phase 2, but across the year filtered year 2021 by Phase1, but based on all costs that were realised in Phase2, in year 2021 ?... Please see scenario in following picture:

DataSheet_3-1683137215424.png

 

Thank you thousand times for any help or advice.

 

Sincerely

F

2 REPLIES 2
tamerj1
Super User
Super User

Hi @DataSheet 

the first thing you need to do is to unpivot the three date columns using power query. That would leave the table with three columns; [Cost], [Attribute] or you can rename it "Phase" and [Value] or you can rename it "Date". 
Then you can create the relationship between 'Date'[Date] and 'Table'[Date] then place the 'Date'[Date] column in the x-axis and the 'Table'[Phase] column in the legend. Create a Year column in the 'Date' table and use it in slicer and NEVER use the auto generated date hierarchy.
The running total measure would be 

 

=
CALCULATE ( SUM ( 'Table'[Cost] ), 'Date'[Date] <= MAX ( 'Date'[Date] ), ALLSELECTED ( 'Date' ) )

 

ALLSELECTED is added just incase you wanted to use for example Month or Week Number instead of Date

DataSheet
New Member

UPDATE: please kindly ingore the second "general table" under the headline: another visualisation, since I have upladed wrong picture. This is the correct one:

DataSheet_6-1683137476159.png

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.