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

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

Reply
PrinceII
Frequent Visitor

Cumulative stops every year. I do not want that

Every year the cumulative resets. I dont want that rest every year. I use the dax query

CUMULATIVE Total =
CALCULATE(
COUNT('ALL_PROJECTS_RPT'[CONTRACTOR]),
FILTER(
ALL('ALL_PROJECTS_RPT'),
( 'ALL_PROJECTS_RPT'[Week] <= MAX('ALL_PROJECTS_RPT'[WeekCum])
)
)
)

 

PrinceII_0-1638879510409.png

 

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @PrinceII 

 

I'm pretty sure @Greg_Deckler  solution will solve your problem, but a solution comes to my mind as below:

First add a new Column to your table:

YearWeek =
Var _W = if('ALL_PROJECTS_RPT'[Week]<10,0&'ALL_PROJECTS_RPT'[Week],'ALL_PROJECTS_RPT'[Week])
return
'ALL_PROJECTS_RPT'[Year]&_W

 

Then use it in measure:

CUMULATIVE Total =
CALCULATE(
COUNT('ALL_PROJECTS_RPT'[CONTRACTOR]),
FILTER(
ALL('ALL_PROJECTS_RPT'),
'ALL_PROJECTS_RPT'[YearWeek] <= Max(ALL_PROJECTS_RPT'[YearWeek]
)
)

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

7 REPLIES 7
VahidDM
Super User
Super User

Hi @PrinceII 

 

I'm pretty sure @Greg_Deckler  solution will solve your problem, but a solution comes to my mind as below:

First add a new Column to your table:

YearWeek =
Var _W = if('ALL_PROJECTS_RPT'[Week]<10,0&'ALL_PROJECTS_RPT'[Week],'ALL_PROJECTS_RPT'[Week])
return
'ALL_PROJECTS_RPT'[Year]&_W

 

Then use it in measure:

CUMULATIVE Total =
CALCULATE(
COUNT('ALL_PROJECTS_RPT'[CONTRACTOR]),
FILTER(
ALL('ALL_PROJECTS_RPT'),
'ALL_PROJECTS_RPT'[YearWeek] <= Max(ALL_PROJECTS_RPT'[YearWeek]
)
)

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Mikelytics
Resident Rockstar
Resident Rockstar

@PrinceII 

 

I think the reason is because you apply the

( 'ALL_PROJECTS_RPT'[Week] <= MAX('ALL_PROJECTS_RPT'[WeekCum])

on the week column. When a new year starts your reference values drops from 50 to 1 which lets DAX only consider the values <= 1. But when you use the date column it should work.

 

Why do you not use the date column with a date table?

CALCULATE(
    [Measure],
    FILTER(
        ALL('Date'),
        'Date'[Date]<=MAX('Date'[Date])
    )
)

 

________________________

If this post helps, then please Accept it as the solution to help other community members find it more quickly

Click on the Thumbs-Up icon if you like this reply.

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

@Mikelytics when i do that I dont get what I want

 

PrinceII_0-1638882080654.png

 

Can you please try it with the same slicer you used before?

Mikelytics_0-1638882285993.png

and thena lso witht the same axis?

Mikelytics_1-1638882373653.png

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!
Greg_Deckler
Community Champion
Community Champion

@PrinceII I would recommend creating a Sequential week column like this: Sequential - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler , I created the sequential. not sure about the next steps. As would still want to see the weeks and year in de axis. 

@PrinceII I'm thinking you would replace that last part of your formula with sequential.

CUMULATIVE Total =
CALCULATE(
COUNT('ALL_PROJECTS_RPT'[CONTRACTOR]),
FILTER(
ALL('ALL_PROJECTS_RPT'),
( 'ALL_PROJECTS_RPT'[Week] <= [sequential]
)
)
)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.