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
Aymen_Soussi
Frequent Visitor

Cumulated value Between 2 years.

Hello I'm new to DAX Syntaxe and I want to create a mesure that calculate the cumulative value of the budget for the years 2021 and 2022 . exemple: budget for date 01/01/2021 :200 and budget for 01/01/2022 : 200 ,  the result should be cumulative for 01/01/2021: 200 and for 01/01/2022: 400 . By this formula the result is good for the year 2021 but the cumulative value for 2022 is giving a value more than the expected again as I sad the SUM need to be only between the same dates 01/01/2021 goes with 01/01/2022.

Power bi accumulated budget  issue.png

The current code That I have used is: 

 

Accumulated =
VAR vCurrentYear = YEAR( MAX( Abfrage1[date] ) )
RETURN
    IF(
        vCurrentYear = 2022,
        CALCULATE(
            SUM( Abfrage1[budget] ),
            DATESINPERIOD(
                'Abfrage1'[Date],
                MAX( 'Abfrage1'[Date] ),
                -1,
                YEAR
            )
        ),
        SUM( Abfrage1[budget] )
    )

 

 

 

1 REPLY 1
rfigtree
Resolver III
Resolver III

Sorry if i am mis-understanding. But If you have budgets set for each month of 2021 then your measure for 2022 will be the sum of all the budgets in the range. Not just 200+200. But 200+200+200+200+....

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.