Forum Discussion

YIAX's avatar
YIAX
Frequent Visitor
1 year ago

Calculating SUMX not correct

I am working an calculating the average for a set of rows based on a filter. The percentage 77.27 is incorrect since the average of the set would actually be 86.36.

Expected Percentage = 19/22 = .8636
Actual = .7727
[ROW_PERCENTAGE] is a measurement that take place on a row basis.
I am using this mea
Numerator_Measure = CALCULATE(SUMX(ALLSELECTED(TABLE),[ROW_PERCENTAGE]),TABLE[STAGE]=="STAGE 1")))
Denominator_Measure = CALCULATE(COUNTROWS(TABLE),FILTER(ALL(TABLE),TABLE[STAGE]=="STAGE 1")))
Stage_Percentage = DIVIDE(Numerator_Measure,Denominator_Measure) 



My numerator measure must be incorrect.

3 Replies

  • YIAX's avatar
    YIAX
    Frequent Visitor

    I ended up scrapping the formula since it was no longer needed. Thank you everyone

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    YIAX Try this:

    Numerator_Measure = SUMX( FILTER( ALLSELECTED(TABLE), [STAGE] == "STAGE 1" ),[ROW_PERCENTAGE])
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, YIAX 

     

    I tried to restore some of the data to try your formula, but my measure are correct.

    Can you provide more details about the data?

     

    Best Regards,

    Community Support Team _Charlotte

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