Forum Discussion

JeanMariePBI's avatar
JeanMariePBI
Helper I
4 years ago
Solved

Incorrect Total in Measure

Hello,    The total in my measure for "Elasticity" is incorrect and it is still calculating rows that I have tried to filter out.   I need the total in the measure to only calculate the rows that ha...
  • v-henryk-mstf's avatar
    4 years ago

    Hi JeanMariePBI ,

     

    In general for this problem, try to use the sumx function for accumulation, similar to the following.

    M =
    VAR a =
        CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[ID] ) )
    RETURN
        IF ( a > 2, SUM ( 'Table'[Value] ), BLANK () )
    
    M_ = SUMX('Table',[M])


    If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


    Best Regards,
    Henry


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