Forum Discussion

roelf's avatar
roelf
Icon for Helper II rankHelper II
7 years ago
Solved

SUM Based on values in another column

Hi   Probably a very basic question, but I"m stuck.   My table looks like this   Customer  Week Sale A                  1       100 B                  1        200 A                  1      ...
  • affan's avatar
    7 years ago

    Hi roelf,

     

    A simple SUM with filter would resolve the requirement

     

    Total = CALCULATE(SUM('Table'[Sale]),ALLEXCEPT('Table','Table'[Customer],'Table'[Week]))

     

     

     

     

    Please mark this post as an accepted solution if this helped you.

     

    Regards,

    Affan

  • Ashish_Mathur's avatar
    7 years ago

    Hi,

     

    In a Matrix visual, drag all columns to the Row labels section.  Write this measure

     

    =CALCULATE(SUM(Data[Sale]),ALL(Data[Week])

     

    Hope this helps.

  • v-frfei-msft's avatar
    v-frfei-msft
    7 years ago

    Hi roelf,

     

    One sample for your reference. Here we need to create a measure as below.

     

    Measure = CALCULATE(SUM(Table1[Sale]),ALLEXCEPT(Table1,Table1[Customer],Table1[Week]))

     

    Also please find the pbix as attached.

     

    Regards,

    Frank

  • v-frfei-msft's avatar
    7 years ago

    Hi roelf,

     

    Does that make sense? If so, kindly mark my answer as a solution to close the case.

     

    Regards,
    Frank