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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Gdibbs
Helper I
Helper I

Cumulating percent development year over year

Hello,

 

I am really stuck and need some guidance.  

 

I have 5 years worth of sales data which I have converted to a % of total sales over the selected period.  I have also built a measure that allows me to cumulate these percentages to 100% over the selected period of time.

 

What I cannot figure out is the following:  I want to be able to look at the cumulative % development for each year (from Jan-Dec) on the same line chart - using DAX..  I can look at one year at a time, but if I select all the years they stack to cumulatively get me to 100%.  I need to see them discretly built to 100%. 

 

How I get the percentage of volume to total volume per month:

% Volume Total = divide (SUM(Greg_SCOPS_Excellence[Base Quantity (SKU)]), CALCULATE(sum(Greg_SCOPS_Excellence[Base Quantity (SKU)]), ALLSELECTED()))
 
How I cumulate:  
Cumu Volume % = (divide([Cumu Volume Count], CALCULATE([Cumu Volume Count], ALLSELECTED(Greg_SCOPS_Excellence)), blank()))
 
How I attempted (this one of a few different attempts) to cumulate year by year:
GJD Cumu Development YoY = CALCULATE(divide([Cumu Volume Count], CALCULATE([Cumu Volume Count], FILTER(ALLSELECTED(Greg_SCOPS_Excellence), Greg_SCOPS_Excellence[Calendar Day].[Year] <= MAX(Greg_SCOPS_Excellence[Calendar Day].[Year])))))
 
What I get:
Gdibbs_0-1628015009265.png

 

Above is wrong (last column) because if I just select 2017 I get this result, which is correct.

Gdibbs_1-1628015095885.png

 

I am new to Power BI and am learning, so any help and explanation as to how to approach this would be greatly appreciated.

1 ACCEPTED SOLUTION
Mohammad_Refaei
Solution Specialist
Solution Specialist

In this example you should use simple time intelligence functionalities.

I would calculate the measure using the DATESYTD and then it should relflect the correct figures.

Assuming that you have a calendar table, you can use this measure:

 

Volume YTD% =
DIVIDE (
    CALCULATE (
        SUM ( Greg_SCOPS_Excellence[Base Quantity (SKU)] ),
        DATESYTD ( 'Calendar'[Date] )
    ),
    CALCULATE (
        SUM ( Greg_SCOPS_Excellence[Base Quantity (SKU)] ),
        ALLEXCEPT ( 'Calendar', 'Calendar'[Year] )
    )
)

 

View solution in original post

1 REPLY 1
Mohammad_Refaei
Solution Specialist
Solution Specialist

In this example you should use simple time intelligence functionalities.

I would calculate the measure using the DATESYTD and then it should relflect the correct figures.

Assuming that you have a calendar table, you can use this measure:

 

Volume YTD% =
DIVIDE (
    CALCULATE (
        SUM ( Greg_SCOPS_Excellence[Base Quantity (SKU)] ),
        DATESYTD ( 'Calendar'[Date] )
    ),
    CALCULATE (
        SUM ( Greg_SCOPS_Excellence[Base Quantity (SKU)] ),
        ALLEXCEPT ( 'Calendar', 'Calendar'[Year] )
    )
)

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors