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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
LeonardSchwenk
Frequent Visitor

Get cumulative value for each day and reset value each year.

Hi,
the are already a lot of topics based on cumulative in power bi but I coudn't figure it out so far.
What I have:

DateproductIDvalue
01.01.2022127030000
01.01.20221280200000
02.01.20221280 -50
01.02.20221280100
01.02.20221280200
01.02.20221270-20
01.03.2022127080
29.12.20221270100
29.12.2022128010
31.12.2022127035
31.12.202212705
01.01.2023127050000
01.01.20231280100000
04.01.2023127050
06.01.20231280-100


Value should be calculated cumulative per day with a fresh start from each year and per productID.

What I want as a measure is Cumulative Per Year.

DateproductIDvalueCumulative per Year
01.01.202212703000030000
01.01.20221280200000200000
02.01.20221280 -50199950
01.02.20221280100200050
01.02.20221280200200250
01.02.20221270-2029980
01.03.202212708030060
29.12.2022127010030160
29.12.2022128010200260
31.12.202212703530195
31.12.20221270530200
01.01.202312705000050000
01.01.20231280100000100000
04.01.202312705050050
06.01.20231280-10099900

 

Thanks for any help.

This post was very close but I coudnt use the answer for my needs.
https://community.powerbi.com/t5/Desktop/How-to-calculate-cumulative-values-by-daily/m-p/503511#M235... 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@LeonardSchwenk,

 

Try this measure:

 

Cumulative per Year = 
CALCULATE (
    SUM ( Table1[value] ),
    FILTER (
        ALLSELECTED ( Table1 ),
        Table1[productID] = MAX ( Table1[productID] )
            && Table1[Date] <= MAX ( Table1[Date] )
            && YEAR ( Table1[Date] ) = YEAR ( MAX ( Table1[Date] ) )
    )
)

 

DataInsights_0-1666708976797.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
DataInsights
Super User
Super User

@LeonardSchwenk,

 

Try this measure:

 

Cumulative per Year = 
CALCULATE (
    SUM ( Table1[value] ),
    FILTER (
        ALLSELECTED ( Table1 ),
        Table1[productID] = MAX ( Table1[productID] )
            && Table1[Date] <= MAX ( Table1[Date] )
            && YEAR ( Table1[Date] ) = YEAR ( MAX ( Table1[Date] ) )
    )
)

 

DataInsights_0-1666708976797.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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