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

Cumulative Year to Date with multiple categories

Hi,

 

I have a table with data for multiple employees who recieve bonuses on a monthly basis. I want to calculate the Cumulative Year to Date for each employee and display this in a table column. How do I get the cumulative YTD for each specific employee in the YTD column. I also need to get a summary for Each employee with the YTD for the given year as seen in the second table.

 

Employee BonusDateBonusYTD
Jane11/1/2016100100
Sam11/1/2016120120
Kevin11/1/2016130130
Jane12/1/2016105205
Sam12/1/2016125245
Kevin12/1/2016135165
Jane1/1/2017100100
Sam1/1/2017120120
Kevin1/1/2017130130
Jane2/1/2017105205
Sam2/1/2017125245
Kevin2/1/2017135265
Jane3/1/2017100305
Sam3/1/2017120365
Kevin3/1/2017130395

 

YearEmployeeBonus YTD
2016Jane205
2016Sam245
2016Kevin165
2017Jane305
2017Sam365
2017Kevin395
1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @qquestel,

 

Based on my test, you should be able to use the formula below to the cumulative YTD for each specific employee in the YTD column.

YTD = 
CALCULATE (
    SUM ( Table1[Bonus] ),
    FILTER (
        ALL ( Table1 ),
        Table1[Employee] = EARLIER ( Table1[Employee] )
            && Table1[BonusDate] <= EARLIER ( Table1[BonusDate] )
            && YEAR ( Table1[BonusDate] ) = YEAR ( EARLIER ( Table1[BonusDate] ) )
    )
)

c1.PNG

 

To get a summary for Each employee with the YTD for the given year, you can firstly add Year column in your table with the formula below.

Year = YEAR(Table1[BonusDate])

Then you should be able to use the formula below to create a new calculate table to get the expected result.

Table = 
SUMMARIZE (
    Table1,
    Table1[Year],
    Table1[Employee],
    "Bonus YTD", MAX ( Table1[YTD] )
)

t1.PNG

 

Here is sample pbix file for your reference. Smiley Happy

 

Regards

View solution in original post

1 REPLY 1
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @qquestel,

 

Based on my test, you should be able to use the formula below to the cumulative YTD for each specific employee in the YTD column.

YTD = 
CALCULATE (
    SUM ( Table1[Bonus] ),
    FILTER (
        ALL ( Table1 ),
        Table1[Employee] = EARLIER ( Table1[Employee] )
            && Table1[BonusDate] <= EARLIER ( Table1[BonusDate] )
            && YEAR ( Table1[BonusDate] ) = YEAR ( EARLIER ( Table1[BonusDate] ) )
    )
)

c1.PNG

 

To get a summary for Each employee with the YTD for the given year, you can firstly add Year column in your table with the formula below.

Year = YEAR(Table1[BonusDate])

Then you should be able to use the formula below to create a new calculate table to get the expected result.

Table = 
SUMMARIZE (
    Table1,
    Table1[Year],
    Table1[Employee],
    "Bonus YTD", MAX ( Table1[YTD] )
)

t1.PNG

 

Here is sample pbix file for your reference. Smiley Happy

 

Regards

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.