Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Filtering Running Total

Hi there, I'm facing some trouble here when trying to insert a filtering condition for a Running Total of cumulative sales. Althought the running total without filter runs perfectly, when I try t...
  • mahoneypat's avatar
    6 years ago

    Try this measure instead.  Filtering the whole Sales table is affected your filters more than you intended.  Note that I changed your ALLSELECTED() part too.  If this doesn't work, you can change it back to ALLSELECTED('Sales').  I don't know your model, so could be either way.

     

    M Filtered Sales SUM running total over Date =
    CALCULATE(
    SUM('Sales'[Value]);
    'Sales'[Country]="Brazil";
    FILTER( ALLSELECTED('Sales'[Date]); 'Sales'[Date] <= MAX ( 'Sales'[Date] ) ))

     

    If this solution works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat