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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
AllanBerces
Post Prodigy
Post Prodigy

Cumulative base on 3 column

Hi good day can anyone help me on my calculated column, i need the cumulative sum of Treade base from Area, Week No. and Trade

AllanBerces_0-1753258740707.png

DESIRED OUTPUT

AllanBerces_1-1753258786138.png

Thank you

2 ACCEPTED SOLUTIONS
wardy912
Memorable Member
Memorable Member

Hi @AllanBerces 

 Try this

Cumulative_Trade = 
CALCULATE(
    SUM('YourTable'[Weekly_Pl]),
    FILTER(
        ALL('YourTable'),
        'YourTable'[Area] = EARLIER('YourTable'[Area]) &&
        'YourTable'[Trade] = EARLIER('YourTable'[Trade]) &&
        'YourTable'[Week No.] <= EARLIER('YourTable'[Week No.])
    )
)

 

Hope this helps, please give a thumbs up and mark as solved if it does, thanks!

View solution in original post

SamWiseOwl
Super User
Super User

Hi @AllanBerces 

 

Cum_Trade =
var CurrentArea = [Area]
var CurrentWeek = [Week No.]

var Trade = [Trade]

Return
Calculate(
Sum(table[Weekly Plan])

 ,table[Area] = CurrentArea
,table[Week No.] <=  CurrentWeek

table [Trade] = Trade
)

Capture the current filters into variables and then ask it to sum the target column after adding some filters.


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

View solution in original post

4 REPLIES 4
SamWiseOwl
Super User
Super User

Hi @AllanBerces 

 

Cum_Trade =
var CurrentArea = [Area]
var CurrentWeek = [Week No.]

var Trade = [Trade]

Return
Calculate(
Sum(table[Weekly Plan])

 ,table[Area] = CurrentArea
,table[Week No.] <=  CurrentWeek

table [Trade] = Trade
)

Capture the current filters into variables and then ask it to sum the target column after adding some filters.


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

wardy912
Memorable Member
Memorable Member

Hi @AllanBerces 

 Try this

Cumulative_Trade = 
CALCULATE(
    SUM('YourTable'[Weekly_Pl]),
    FILTER(
        ALL('YourTable'),
        'YourTable'[Area] = EARLIER('YourTable'[Area]) &&
        'YourTable'[Trade] = EARLIER('YourTable'[Trade]) &&
        'YourTable'[Week No.] <= EARLIER('YourTable'[Week No.])
    )
)

 

Hope this helps, please give a thumbs up and mark as solved if it does, thanks!

Hi @wardy912 @SamWiseOwl @FBergamaschi thank you very much for the reply work perfectly

FBergamaschi
Solution Sage
Solution Sage

Your question is unclear to me, can you specify better please giving details of the columns to use and show an example?

 

Thanks

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.