Forum Discussion

Rigolleto's avatar
Rigolleto
Resolver I
7 years ago
Solved

Sum up a column value one time

Hi ,

I have a query to show information as the picture shown but, I am stuck about the logic to take only one row/value from one of the columns, for intance, you can notice that he column "SALES LY" has the value duplicated, in my example you can see that only need one of the values, base on the componed group of columns, SEASON+GARM+STY, Do I need to do is summarize the column SALES add the total of that column add up to the column SALES LY but, from this column I only need the last value of the grouping , any body can help me, I did create a measure but, it is not working, the big issue get the last record of the SALES LY coulumn,

 

  • Hi Rigolleto ,

     

    You need to create a new measure.

    Sales+Need =
    VAR salessum =
        CALCULATE ( SUM ( test[SALES] ), ALLEXCEPT ( test, test[GARM], test[STY] ) )
    VAR need =
        CALCULATE ( MAX ( test[SALES LY] ), ALLEXCEPT ( test, test[GARM], test[STY] ) )
    RETURN
        salessum + need
    

    Here is the result.

     

    Best Regards,

    Eads

     

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

1 Reply

  • v-eachen-msft's avatar
    v-eachen-msft
    Community Support

    Hi Rigolleto ,

     

    You need to create a new measure.

    Sales+Need =
    VAR salessum =
        CALCULATE ( SUM ( test[SALES] ), ALLEXCEPT ( test, test[GARM], test[STY] ) )
    VAR need =
        CALCULATE ( MAX ( test[SALES LY] ), ALLEXCEPT ( test, test[GARM], test[STY] ) )
    RETURN
        salessum + need
    

    Here is the result.

     

    Best Regards,

    Eads

     

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