cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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 wellimage.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
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!

View solution in original post

1 REPLY 1
Highlighted
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!

View solution in original post

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

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

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors