Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jeyare
Helper II
Helper II

Cumulative SUM of Incremental values based on FIltered conditions

Hi, 

I have this source tab example:

datebranchincrement
1.4.2020A0
1.4.2020B2
1.4.2020C21
2.4.2020A5
2.4.2020B9
2.4.2020C4
3.4.2020A12
3.4.2020B3
3.4.2020C7

 

I can't find right approach to Calculate Cumulative SUM of column [increment] on daily base, for each branch independently. My targeted table is based on this algorithm for new Column [Totals]:

- Earlier day in the table for [branch] value , then [Totals]= [increment]

- another day after the Earlier day for [branch] value, then [Totals]= Current [increment] + previous value in [Totals]

 

datebranchincrementTotals
1.4.2020A00
1.4.2020B22
1.4.2020C2121
2.4.2020A55
2.4.2020B911
2.4.2020C425
3.4.2020A1217
3.4.2020B312
3.4.2020C711

 

Thx for a help, I learn quickly.

1 ACCEPTED SOLUTION

got it by my self:

 

CALCULATE(SUM(Table[increment]);FILTER(Table;Table[branch]=EARLIEST([branch]) && ([date]-1) < EARLIEST([date])))

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

cumulative. The adjective cumulative describes the total amount of something when it's all added together. ... The cumulative snowfall for the whole winter isn't just the amount of snow that fell in one month, but rather the number of inches that fell every month that winter to get the total, cumulative, amount.

@Anonymous , no doubt about your description of the "cumulative" adjective

what is in line with my "expected" target algorithm:

In the new column I need calculate cumulative sum of all incremental values for each row defined by date

from beginning (very first date) to end (very last date)

then, follow your description:

I need calclutate cumulative  "snowfall" for each day of the winter based on daily increments = sum of snowfall till each day (defined by rows)

clear?

 

got it by my self:

 

CALCULATE(SUM(Table[increment]);FILTER(Table;Table[branch]=EARLIEST([branch]) && ([date]-1) < EARLIEST([date])))
amitchandak
Super User
Super User

@jeyare ,

Try like

Cumm Total = CALCULATE(SUM(Table[increment]),filter(all(Table),Table[date] <=max(Table[date]) && Table[branch] =max(Table[branch])))

Or
Cumm Total = CALCULATE(SUM(Table[increment]),filter(allselected(Table),Table[date] <=max(Table[date]) && Table[branch] =max(Table[branch])))

@amitchandak 

 

thx, but doesn't work

ALL also ALLSELECTED

provide for each row in the new column same value 32

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.