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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
faisalek
Frequent Visitor

Calculate Remaining Efforts based on the Completed Efforts on previous dates

     I would like to know how to calculate  the remaining efforts based on the completed efforts on previous dates. I have a table like below where it has a Key (ID) , Completed Date, Total Effort for that Key (ID) and completed efforts on the given date.

 

IDCompleted onTotal EffortsCompleted
AG-10722 November 20194917
AG-10720 December 2019496
AG-10717 January 2020492
AG-10714 February 2020493
AG-10728 February 2020497
AG-10713 March 2020499
AG-10727 March 2020495
AG-11519 June 2020298
AG-11520 December 2019292
AG-11517 January 2020294
AG-11506 December 2019296
AG-11531 January 2020297
AG-11513 March 2020292

 

Now, I want to calulcate the column called "Remaining efforts" which is the effort remaining to complete on that date. ( Total Efforts - Efforts completed till that date) like below.

 

IDCompleted onTotal EffortsCompletedRemaining Efforts
AG-10722 November 2019491732
AG-10720 December 201949626
AG-10717 January 202049224
AG-10714 February 202049321
AG-10728 February 202049714
AG-10713 March 20204995
AG-10727 March 20204950
AG-11519 June 202029821
AG-11520 December 201929219
AG-11517 January 202029415
AG-11506 December 20192969
AG-11531 January 20202972
AG-11513 March 20202920

 

I tried like below,

 

MAX('Effort Breakdown'[Total Efforts]) -SUMX(FILTER(All( 'Effort Breakdown'[Completed on]), 'Effort Breakdown'[Completed on] <= EARLIER('Effort Breakdown'[Completed on])) , [Total Completed] )

and 

Total Completed is a Measure with formula If(ISBLANK(SUM( 'Effort Breakdown'[Total Completed] )),0, SUM('Effort Breakdown'[Total Completed] ))

 

 

But remaining values are not coming as expected.  Could you please help me how can I achieve this?

1 ACCEPTED SOLUTION
nandukrishnavs
Super User
Super User

@faisalek 

 

If you are looking for a calculated column, try below DAX

Remaining Effort =
VAR __TotalEffort = [Total Efforts]
VAR __CompletedEffort =
    SUMX (
        FILTER (
            'Effort Breakdown',
            'Effort Breakdown'[ID] = EARLIER ( 'Effort Breakdown'[ID] )
                && 'Effort Breakdown'[Completed on] <= EARLIER ( 'Effort Breakdown'[Completed on] )
        ),
        'Effort Breakdown'[Completed]
    )
VAR __Remaining = __TotalEffort - __CompletedEffort
RETURN
    __Remaining

nandukrishnavs_0-1597903476274.png


Regards,
Nandu Krishna

View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@faisalek 

Plesae try to create an index column , then create a new column

Column = 'Table'[Total Efforts]-SUMX(FILTER('Table','Table'[ID]=EARLIER('Table'[ID])&&'Table'[Index]<=EARLIER('Table'[Index])),'Table'[Completed])

1.PNG 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@faisalek , Try a new column like

[Total Efforts]- sumx(filter(Table, [ID] =earlier([ID]) && [Completed on] <=earlier([Completed on]) ),[Completed])

 

New measure

sumx(Summarize(Table[ID],Table[Completed on],"_1", max([Total Efforts]) - sumx(filter(allselected(Table), [ID] =max([ID]) && [Completed on] <=max([Completed on]) ),[Completed])),[_1])

nandukrishnavs
Super User
Super User

@faisalek 

 

If you are looking for a calculated column, try below DAX

Remaining Effort =
VAR __TotalEffort = [Total Efforts]
VAR __CompletedEffort =
    SUMX (
        FILTER (
            'Effort Breakdown',
            'Effort Breakdown'[ID] = EARLIER ( 'Effort Breakdown'[ID] )
                && 'Effort Breakdown'[Completed on] <= EARLIER ( 'Effort Breakdown'[Completed on] )
        ),
        'Effort Breakdown'[Completed]
    )
VAR __Remaining = __TotalEffort - __CompletedEffort
RETURN
    __Remaining

nandukrishnavs_0-1597903476274.png


Regards,
Nandu Krishna

Great, That works.. Thank you for the replay and effort.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.