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
Manuel123
Helper I
Helper I

Cumulated calculation does not stop with end of data

Dear Community,

 

I hope you can help me with the followind issue:

 

- I have a measure calculated that cumulates a value:

Capacity cumulated = 

var LastPresentationDate = CALCULATE(LASTDATE(tblProject[Presentation.Date]),ALL(tblProject))

return
IF(
    SELECTEDVALUE(tblDate[Date])>LastPresentationDate,BLANK(),
        CALCULATE([Capacity],
            FILTER(
                ALL(tblDate[Date]),
                tblDate[Date]<=min(MAX(tblDate[Date]),DATE(YEAR(TODAY()),12,31))
            )
        )
    )

The LastPresentationDate is 31.01.2023.

However, when I put the values in a bar chart with the date hirarchy as x-axis it shows the cumulated value until the year 2100 instead of stopping in 2023. How can I manage to a bar chart with cumulated values that stops when the values stop, in this example in 2023?

 

I hope I did manage to explain my problem properly, if not please ask.

 

Looking forward to your answers/suggestions/help

 

Best regards

Manuel

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello @Manuel123 ,

I understood your question but the problem is you use selected value to aggregate date value which is in this case is not useful because you didn't have any slicers.

You can use below measure code to achieve your desire output : 

Capacity cumulated =
var LastPresentationDate = CALCULATE(LASTDATE(tblProject[Presentation Date]),ALL(tblProject))

VAR Capacity =
IF(MAX(tblDate[Date]) <= LastPresentationDate,CALCULATE(SUM(tblProject[Capacity]),
FILTER(
ALL(tblDate[Date]),
tblDate[Date]<=min(MAX(tblDate[Date]),DATE(YEAR(TODAY()),12,31))
)
),BLANK() )
return
Capacity

Thanks,
Neel

 

View solution in original post

2 REPLIES 2
Manuel123
Helper I
Helper I

Dear @Anonymous,

 

thank you very much for your fast reply and the perfect working solution.

 

Best regards

Manuel

Anonymous
Not applicable

Hello @Manuel123 ,

I understood your question but the problem is you use selected value to aggregate date value which is in this case is not useful because you didn't have any slicers.

You can use below measure code to achieve your desire output : 

Capacity cumulated =
var LastPresentationDate = CALCULATE(LASTDATE(tblProject[Presentation Date]),ALL(tblProject))

VAR Capacity =
IF(MAX(tblDate[Date]) <= LastPresentationDate,CALCULATE(SUM(tblProject[Capacity]),
FILTER(
ALL(tblDate[Date]),
tblDate[Date]<=min(MAX(tblDate[Date]),DATE(YEAR(TODAY()),12,31))
)
),BLANK() )
return
Capacity

Thanks,
Neel

 

Helpful resources

Announcements
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.

Top Solution Authors
Top Kudoed Authors