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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
ArjanFraaij
Frequent Visitor

Cumulative Total within a date range

Can some explain this to me or at least tell me what I do forget?
Report needs to display cumulative total based on ISO Week numbers. 
ISO Week 2020-01 runs from 30-12-2019 - 05-01-2020, using below forumula works great, only because YTD for week 01 30&31-12-2019 are not calculated, YTD starts from 01-01-2020 ofcourse..

 

Uren budget cumulatief YTD = 
VAR MaxDate = MAX ( LookUp_DeclaratieDatum[Date] )
VAR MinDate = MIN(LookUp_DeclaratieDatum[Date])
RETURN
    CALCULATE (
        IF(ISBLANK([Totaal uren budget]);0;[Totaal uren budget]) ; 
        DATESYTD(LookUp_DeclaratieDatum[Date]);
        LookUp_DeclaratieDatum[Date] <= MaxDate;   
        ALL ( LookUp_DeclaratieDatum )              
    )

 

 

Made me thing to change YTD in DATESBETWEEN... only that doesn't work right as you can see in the matrix below.

 

Uren budget cumulatief Range = 
VAR MaxDate = MAX(LookUp_DeclaratieDatum[Date]) 
VAR MinDate = MIN(LookUp_DeclaratieDatum[Date])
VAR NumberOfDays = DATEDIFF(MinDate;MaxDate;DAY)
RETURN
    CALCULATE (
        IF(ISBLANK([Totaal uren budget]);0;[Totaal uren budget]) ;
        DATESBETWEEN(LookUp_DeclaratieDatum[Date];MinDate;MaxDate);
         ALL(LookUp_DeclaratieDatum)
        )

 

 

Result 

 
 

Cumulative.png

 

What am I forgetting? or is it just not posible to display a cumulative total in this way based on a date range...

1 REPLY 1
Anonymous
Not applicable

For custom calendars, like ISO, you CANNOT use the time-intel functions as they only work against the standard calendar.

https://www.sqlbi.com/blog/marco/2013/02/19/dax-time-intelligence-for-4-4-5-calendar-iso-calendar-an...

Best
D

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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