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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Running total with filter

I need to do a running total calculation for the below 

 

TaskDue DateActual Completion Date
A11/15/20182/4/2018
A22/16/20183/7/2018
A33/20/20181/15/2018
A44/21/20182/16/2018
A55/23/20189/28/2018
A66/24/201810/30/2018
A77/26/201812/1/2018
A88/27/20189/9/2018
A99/28/2018 
A1010/30/2018 
A1112/1/2018 


Conditions :

1)  Task should be included in the Running total if the Actual completion date>"Due .Date" or the Actual completion date is null 

2) For instance, Task A5 has a  due date as 5/23/2018 but task completed on 9/28/2018 , it should be calculated untill the Sep-2018 as a backlog, whereas Task A3 should not be in the Running total 

 

Thanks 

 

6 REPLIES 6
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Is this problem solved?

 

If it is solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.


If not, please let me know.

 


Best Regards
Icey

Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please check if this is what you want:

 

1. Assume that all tasks are assigned on 2018/1/1.

 

2. Create a Calendar table.

Calendar = CALENDAR(DATE(2018,1,1),DATE(2018,12,31))

 

3. Create relationship.

rel.PNG

 

4. Create measures like so:

Measure = 
VAR CurrentDate =
    MAX ( 'Calendar'[Date] )
VAR CurrentDueDate =
    MAX ( 'Table'[Due Date] )
VAR CurrentActualDate =
    IF (
        MAX ( 'Table'[Actual Completion Date] ) = BLANK (),
        TODAY (),
        MAX ( 'Table'[Actual Completion Date] )
    )
VAR DD =
    IF (
        CurrentDueDate <= CurrentActualDate
            && CurrentDate <= CurrentDueDate,
        CurrentDueDate,
        IF (
            CurrentDueDate <= CurrentActualDate
                && CurrentDate >= CurrentDueDate
                && CurrentDate <= CurrentActualDate,
            CurrentActualDate,
            IF (
                CurrentDueDate > CurrentActualDate,
                CurrentActualDate,
                IF ( CurrentActualDate = TODAY (), CurrentDate )
            )
        )
    )
VAR Is1 =
    IF ( DD = CurrentDate, 1, IF ( DD <= MAX ( 'Calendar'[Date] ), 1, 0 ) )
RETURN
    Is1
Running total = 
CALCULATE ( COUNT ( 'Table'[Task] ), ALLSELECTED ( 'Table' ) )
    - CALCULATE (
        SUMX ( 'Calendar', [Measure] ),
        FILTER (
            ALLSELECTED ( 'Calendar' ),
            'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
        )
    )

run.gif

For more details, please check the attached PBIX file.

 

If I understand it wrong, please let me know.

 

 

Best Regards,

Icey

 

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

Ashish_Mathur
Super User
Super User

Hi,

Show the end result that you are expecting.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

Refer this blog to discuss similar stuff :https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Appreciate your Kudos.

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
Greg_Deckler
Community Champion
Community Champion

Is there a values column?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Didn't understand that. As in?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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