Forum Discussion

AllanBerces's avatar
AllanBerces
Post Prodigy
2 years ago
Solved

Calculated Column_Average Earned

Hi Good day, 

Can anyone pls correct my calculated Column, I want the Averge Earned per Task No. I created some but the result no the one i required.

 

1. AVE._EARNED =
AVERAGEX(
SUMMARIZE(
'S-CURVE',
'S-CURVE'[Task No.],
"Ave. Earned", AVERAGE('S-CURVE'[SUM_OF_EARNED])
),
[Ave. Earned]
)

 

RESULT=

 

2.  

AVE._EARNED =
    AVERAGEX(
    KEEPFILTERS(VALUES('S-CURVE'[Task No.])),
    CALCULATE(SUM('S-CURVE'[DAILY_EARNED]))
)
 
RESULT=

 

3.  CALCULATE(
AVERAGE('S-CURVE'[DAILY_EARNED]),
FILTER(ALLSELECTED('S-CURVE'),
'S-CURVE'[Task No.] = MAX('S-CURVE'[Task No.])))

 

RESULT=

 

What i required is, the Task No. NC000135 should be blank or no value since it not  yet started.

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi AllanBerces ,

     

    Please try:

    AVE_EARNED=
    VAR TaskTotalEarned =
         CALCULATE (
             SUM ( 'S-CURVE'[DAILY_EARNED] ),
             ALLEXCEPT ( 'S-CURVE', 'S-CURVE'[Task No.] )
         )
    VAR TaskCountNonZero =
         CALCULATE (
             COUNTROWS ( 'S-CURVE' ),
             'S-CURVE'[DAILY_EARNED] > 0,
             ALLEXCEPT ( 'S-CURVE', 'S-CURVE'[Task No.] )
         )
    RETURN
         IF ( TaskTotalEarned > 0, TaskTotalEarned / TaskCountNonZero, BLANK () )

     

    After creating it, drag it to the report page for display. The page effect is as follows:

     

    pbix file is attached.

     

    If you have any further questions please feel free to contact me.

     

    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi AllanBerces ,

     

    Please try:

    AVE_EARNED=
    VAR TaskTotalEarned =
         CALCULATE (
             SUM ( 'S-CURVE'[DAILY_EARNED] ),
             ALLEXCEPT ( 'S-CURVE', 'S-CURVE'[Task No.] )
         )
    VAR TaskCountNonZero =
         CALCULATE (
             COUNTROWS ( 'S-CURVE' ),
             'S-CURVE'[DAILY_EARNED] > 0,
             ALLEXCEPT ( 'S-CURVE', 'S-CURVE'[Task No.] )
         )
    RETURN
         IF ( TaskTotalEarned > 0, TaskTotalEarned / TaskCountNonZero, BLANK () )

     

    After creating it, drag it to the report page for display. The page effect is as follows:

     

    pbix file is attached.

     

    If you have any further questions please feel free to contact me.

     

    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!