Forum Discussion

larsvedoy's avatar
larsvedoy
Frequent Visitor
9 years ago
Solved

Create running cost column with two filters

I'm trying to make a calculated column for running cost that sums the value in a cost column. My table has to columns that need to match; one column with a  branch number and one colomn with periods....
  • CahabaData's avatar
    CahabaData
    9 years ago

    so its good that a single branch ID is for the whole year and that your period field is a true date field type....  this is air code and I named your table: SampleData ..so you'll want to replace that

     

    Running Cost =

    CALCULATE (

      SUM ( SampleData[Cost] ),

      ALLEXCEPT ( SampleData, SampleData[Branch] ),

      SampleData[Period] <= EARLIER ( SampleData[Period] )

                         )