Forum Discussion

Rigolleto's avatar
Rigolleto
Icon for Resolver I rankResolver 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"...
  • v-eachen-msft's avatar
    7 years ago

    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.