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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Muska_Sukhija
New Member

Help with calculating cumulative change and % in Power BI with multiple months selected

Hi everyone,

I am working on a Power BI dashboard with headcount data and NOT SALES, and I need help calculating cumulative change and cumulative % change when multiple months are selected in the slicer.

Here’s a sample of the data:

Muska_Sukhija_0-1734628245811.png

 

The dataset contains daily headcount data from 2019 to 2024.

Problem Statement:

I want to create a table matrix like this:

Muska_Sukhija_1-1734628299963.png

 

The table should show the cumulative change and cumulative % change, where the data is based on average headcount, and the slicer allows the selection of multiple months. I already have a measure to calculate average headcount when multiple months are selected.

Question:

  • How can I calculate the cumulative change and cumulative % change when selecting multiple months in the slicer?
  • What DAX measures would be needed to achieve this?

Any insights or advice would be greatly appreciated!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Muska_Sukhija ,

Based on the description, creating the new table to calcualte average count.

 

Table 2 = 
SUMMARIZE(
    'Table',
    'Table'[Year],
    "AvgHecount", AVERAGE('Table'[Headcount])
)

 

Then, creating the index column in power query.

vjiewumsft_0-1735285134544.png

Creating new column to calculate the change.

 

Change in preivous year = IF('Table 2'[Index] = 1, 0, [AvgHecount] - LOOKUPVALUE('Table 2'[AvgHecount], [Index], [Index] - 1))

 

vjiewumsft_1-1735285192762.png

Creating the new measure to calculate cumulative change.

 

Cumulative change = 
CALCULATE(
    SUM('Table 2'[Change in preivous year]),
    FILTER(ALL('Table 2'), 'Table 2'[Index] <= MAX('Table 2'[Index])
    )
)

 

Besides, creating the new measure to calucalte %cumulative change and change the percentage format.

 

Cumulative change% = [Cumulative change] / 100

 

vjiewumsft_2-1735285457250.png

vjiewumsft_0-1735545618524.png

What's more, if you want to calculate cumulative, you need to use sum function. If you select multiple months, power bi cannot dynamically generate calculated columns based on slicer values. There would be no way to calculate the cumulative.

Solved: PowerBI Cumulative Total by Month within Year (Fin... - Microsoft Fabric Community

How to Calculate Cumulative Values with DAX - Microsoft Fabric Community

Solved: Cumulative sum of a column - Microsoft Fabric Community

 

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Muska_Sukhija ,

Based on the description, creating the new table to calcualte average count.

 

Table 2 = 
SUMMARIZE(
    'Table',
    'Table'[Year],
    "AvgHecount", AVERAGE('Table'[Headcount])
)

 

Then, creating the index column in power query.

vjiewumsft_0-1735285134544.png

Creating new column to calculate the change.

 

Change in preivous year = IF('Table 2'[Index] = 1, 0, [AvgHecount] - LOOKUPVALUE('Table 2'[AvgHecount], [Index], [Index] - 1))

 

vjiewumsft_1-1735285192762.png

Creating the new measure to calculate cumulative change.

 

Cumulative change = 
CALCULATE(
    SUM('Table 2'[Change in preivous year]),
    FILTER(ALL('Table 2'), 'Table 2'[Index] <= MAX('Table 2'[Index])
    )
)

 

Besides, creating the new measure to calucalte %cumulative change and change the percentage format.

 

Cumulative change% = [Cumulative change] / 100

 

vjiewumsft_2-1735285457250.png

vjiewumsft_0-1735545618524.png

What's more, if you want to calculate cumulative, you need to use sum function. If you select multiple months, power bi cannot dynamically generate calculated columns based on slicer values. There would be no way to calculate the cumulative.

Solved: PowerBI Cumulative Total by Month within Year (Fin... - Microsoft Fabric Community

How to Calculate Cumulative Values with DAX - Microsoft Fabric Community

Solved: Cumulative sum of a column - Microsoft Fabric Community

 

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.