Forum Discussion

philbert119's avatar
philbert119
Regular Visitor
5 years ago

Running Total Calculation without date

I would like to add running totals to each campaign column so that instead of Campaign Day 6 have $26K, it will show $97K because it will add the Day 6 and Day 5 total together. I've seen some solutions for matrices with dates, but this has Campaign Days in the row. The value is sales and Campaign Name is the column value. Please see my table below. Any assistance would be appreciated!

 

5 Replies

  • This should be doable using ALLEXCEPT(). Please provide sample data in usable format (not as a picture).

  • philbert119's avatar
    philbert119
    Regular Visitor

    How would you like me to share the data? As to your ALLEXCEPT() suggestion, how would you suggest using it? Running Total = Sales, ALLEXCEPT(CampaignDay > Current Campaign Day). I'm not sure how to best write the DAX on that. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi philbert119 ,

     

    Try this calculated column

    Running Total COLUMN = 
    CALCULATE (
        SUM ( 'Table'[Column2] ),
        ALLEXCEPT('Table','Table'[Column0]),
        'Table'[Column1] <= EARLIER ( 'Table'[Column1]
    ))

     

    You can check more details from here.

     

     

    Best Regards,

    Stephen Tao

     

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

     

     

    • philbert119's avatar
      philbert119
      Regular Visitor

      I created the variable but i received an error message for the campaign days column, which is a whole number. It said "A single value for column 'Campaign Days' in table cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifiying an aggregation such as min, max, count or sum to get a single result. I tried to change to text but received the same error. 

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi philbert119 ,


        Please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

         


        Best Regards,
        Stephen Tao