Forum Discussion

Pal03's avatar
Pal03
Frequent Visitor
8 years ago
Solved

Sum over partition by

Hello everyone , I am trying to achieve this . I have a table with Date , account , segment , revenue and sector. I am trying to get  total revenue based on Date , Account , segment only.   ...
  • Phil_Seamark's avatar
    8 years ago

    Hi Pal03

     

    Here is how you can do it with a calculated column

     

    Total Revenue = 
        CALCULATE(
            SUM('Table1'[Revenue]),
            FILTER(
                'Table1',
                'Table1'[Date] = EARLIER('Table1'[Date]) &&
                'Table1'[Account] = EARLIER('Table1'[Account]) &&
                'Table1'[Segment] = EARLIER('Table1'[Segment]) 
                )   
    )