cancel
Showing results for
Did you mean:
Highlighted
Frequent Visitor

## Creating a cumulative sum based on filters in the table

Hi All,

I am struggling to solve the below case. I want to do a cumulative sum of the "dosage" column based on the "Case ID_Milestone" key and runing based on the "date" column. instead, I am getting a sum of all the dosage of all the dates combined, not as runing total based on the date. what am I missing?

also, I would like to add another column of the cumulative %, would appreciate your suggestions on how to do it as well

1 ACCEPTED SOLUTION

Accepted Solutions
Frequent Visitor

## Re: Creating a cumulative sum based on filters in the table

was able to solve it! I used:

Cumulative Dosage =

CALCULATE

(SUM ('Daily Dosage'[Dosage]),

FILTER(ALLEXCEPT('Daily Dosage','Daily Dosage'[Case ID_Milestone]),

('Daily Dosage'[date]<=EARLIER('Daily Dosage'[date]))))

basically changed the MAX to EARLIER and it worked!

Frequent Visitor

## Re: Creating a cumulative sum based on filters in the table

was able to solve it! I used:

Cumulative Dosage =

CALCULATE

(SUM ('Daily Dosage'[Dosage]),

FILTER(ALLEXCEPT('Daily Dosage','Daily Dosage'[Case ID_Milestone]),

('Daily Dosage'[date]<=EARLIER('Daily Dosage'[date]))))

basically changed the MAX to EARLIER and it worked!

Announcements

#### August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

#### Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

#### Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

#### Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors