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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Hareensunny
Frequent Visitor

DAX cummulative sum by multiple variables

IMG_3800.jpeg

I need to create a new column where it is cummulative sum of sales.

 

I have following variables:

A: Fiscal year

B: Month

C: Factory

D:: Business

E: Department

 

I would like to have cummulative sum for sales colum is F using above variables.

 

could someone help.

 

2 ACCEPTED SOLUTIONS
VahidDM
Super User
Super User

Hi @Hareensunny 

 

Can you post sample data as text and expected output?
Not enough information to go on;

please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
4. Relation between your tables

Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/

View solution in original post

Anonymous
Not applicable

Hi @Hareensunny ,

Please try to create a new column with below dax formula:

 

Cummulative Sum =
VAR _a = [Column1]
VAR _b = [Column2]
VAR _c = [Column3]
VAR _d = [Column4]
VAR _e = [Column5]
VAR tmp =
    FILTER (
        'Table',
        [Column1] = _a
            && MONTH ( [Column2] ) = MONTH ( _b )
            && [Column3] = _c
            && [Column4] = _d
    )
VAR tmp1 =
    FILTER ( tmp, [Column2] <= _b )
RETURN
    SUMX ( tmp1, [Column6] )

 

vbinbinyumsft_0-1699497021558.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Hareensunny ,

Please try to create a new column with below dax formula:

 

Cummulative Sum =
VAR _a = [Column1]
VAR _b = [Column2]
VAR _c = [Column3]
VAR _d = [Column4]
VAR _e = [Column5]
VAR tmp =
    FILTER (
        'Table',
        [Column1] = _a
            && MONTH ( [Column2] ) = MONTH ( _b )
            && [Column3] = _c
            && [Column4] = _d
    )
VAR tmp1 =
    FILTER ( tmp, [Column2] <= _b )
RETURN
    SUMX ( tmp1, [Column6] )

 

vbinbinyumsft_0-1699497021558.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

VahidDM
Super User
Super User

Hi @Hareensunny 

 

Can you post sample data as text and expected output?
Not enough information to go on;

please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
4. Relation between your tables

Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.