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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
COBRIEN
Frequent Visitor

Running Total Using a Date Input

Hi,

 

I am trying to create a Line and Clustered Column Chart to represent actual and outstanding cumulative values (Line) and period values (Clustered Columns) for a dataset.  The shared axis represents week ending date (Friday) and is intentionally set to Type = Continuous in the format tab even though my dataset does not have period values for every week ending data point.  I have managed to complete most of what I need but am running into a few issues.

 

The cumulative outstanding line should start where the cumulative actual line ends however if there is a gap in the continuity of the dataset on the week ending where they should meet it is shown as a gap between the lines.  Please see the table below for an example.

 

Week EndingActual PeriodActual CumulativeOutstanding PeriodOutstanding CumulativeActual Cumulative (Desired)Outstanding Cumulative (Desired)

18-Sep-20

88  8 
25-Sep-20210  10 
02-Oct-20    10 
09-Oct-20    10 
16-Oct-20     10
23-Oct-20  1828 28
30-Oct-20  1139 39

 

I have created a measure to calculate the week ending of the previous week Previous Week Ending =

IF(WEEKDAY(TODAY(),2)>5,(TODAY()-(WEEKDAY(TODAY(),2)-5)),(TODAY()+(5-(WEEKDAY(TODAY(),2))-7))).
 

The Actual Cumulative value needs to populate up to the Previous Week Ending date that is calculated in the measure ignoring the fact that there are blank period values.  The Outstanding Cumulative needs to begin the week following the Previous Week Ending measure.

 

The measures for Actual and Outstanding Cumulative are as follows:

 

Actual Cumulative =
    IF(ISBLANK(SUM(Table[Actual Period])),BLANK(),
    CALCULATE(SUM(Table[Actual Period]),
    FILTER(
        ALLSELECTED(Table[Week Ending]),
        ISONORAFTER(Table[Week Ending],MAX(Table[Week Ending]),DESC)
    )
))
 
Outstanding Cumulative =
IF(ISBLANK(SUM(Table[Outstanding Period])),BLANK(),
CALCULATE(
    SUM(Table[Outstanding Period])+SUM(Table[Actual Period]),
    FILTER(
        ALLSELECTED(Table[Week Ending]),
        ISONORAFTER(Table[Week Ending], MAX(Table[Week Ending]), DESC)
    )
))
 
Thanks in advance for any help provided.
2 REPLIES 2
amitchandak
Super User
Super User

@COBRIEN , Try like

 

Actual Cumulative =
IF(max(Table[Week Ending])>=today(),BLANK(),
CALCULATE(SUM(Table[Actual Period]),
FILTER(
ALLSELECTED(Table[Week Ending]),
ISONORAFTER(Table[Week Ending],MAX(Table[Week Ending]),DESC)
)
))

Outstanding Cumulative =
IF(max(Table[Week Ending])<=today(),BLANK(),
CALCULATE(
SUM(Table[Outstanding Period])+SUM(Table[Actual Period]),
FILTER(
ALLSELECTED(Table[Week Ending]),
ISONORAFTER(Table[Week Ending], MAX(Table[Week Ending]), DESC)
)
))

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

Thanks for the reply, unfortunately this did not seem to solve my problem.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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