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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
RockandGrohl
Frequent Visitor

Cumulative Total in Stacked Bar Chart not working

Hi, not sure what I'm doing wrong here as I followed the exact steps from another user with the same issue.

 

re dataset.pngre example.png

 

Here's my dataset & what is displaying.



Cumulative MW =
CALCULATE(
    SUM('AR Results'[MW]),
    FILTER(
        ALLEXCEPT('AR Results','AR Results'[Tech Type]),
        'AR Results'[DeliveryYearNum] <= MAX('AR Results'[DeliveryYearNum])
    )
)
 

That's my measure for cumulative, it looks exactly like other solved examples in this forum.

 

 

So mine should be showing the same but it's clearly nothing like a cumulative chart.

5 REPLIES 5
v-hashadapu
Community Support
Community Support

Hi @RockandGrohl , Thank you for reaching out to the Microsoft Community Forum.

 

Just to make sure I understand your issue correctly, could you clarify one thing about the requirement? Are you simply looking for the cumulative MW to calculate and display correctly for each Tech Type based on the data that exists for each Delivery Year or do you also expect all Tech Types to appear in every year even when there is no data (showing zero values)?

 

The solution I shared focuses on fixing the cumulative behaviour in the stacked chart. If the requirement is the latter as @MFelix says, then using a disconnected or dimension table like they suggested would be the correct approach.

v-hashadapu
Community Support
Community Support

Hi @RockandGrohl , Thank you for reaching out to the Microsoft Community Forum.

 

The issue wasn’t the cumulative logic itself, but the evaluation context created by the stacked column chart. Your measure was calculating cumulatives correctly in isolation, but the X-axis was using a different year column than the one driving the cumulative comparison. In stacked visuals, that mismatch causes each legend segment to evaluate its own year context, which leads to the non-cumulative looking bars.

 

Align the axis with the same numeric year column used in the measure (DeliveryYearNum), ensure the axis is categorical and sorted ascending. Once the axis context is stable, the cumulative DAX behaves exactly as expected for each Tech Type, without needing disconnected tables or model changes. You can verify this by comparing the table visual (which shows correct cumulative values per tech and year) with the stacked column chart, they now match in all cases.

 

To help you better understand the implementation, I’ve attached the .pbix file for your reference. Please take a look at it and let me know your observations.

Hi @v-hashadapu 

 

Apologies for jumping in but this solution does not answer the question of @RockandGrohl  because the problem is that in certain years there aren't certain categories so when they are missing the values are not showing up in the chart that is why you need to have the disconnected table is not a question about the sorting but about the context of the data that is not present when you use a column from the fact table instead of a dimension table or a disconnected table.

 

Picking your example I added a new category on 2017 and 2019 and we get a break in the chart:

 

MFelix_0-1767981378001.png

 

 

But please @RockandGrohl  lert us know what is the correct problem you are facing.

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



MFelix
Super User
Super User

Hi @RockandGrohl ,

 

The question is that you are doing a cumulative based on the tech so for each tech value you are getting the cumulative, however there are no tech values for specific years so that value is not represented on your calculation.

 

If you look at Solar PV or Offshore wind you will see that cumultive effect.

 

To solve this you need to have a disconnected table with the tech typwes then change you calculation to the following:

 

Cumulative MW = 
CALCULATE(
    SUM('AR Results'[MW]),
    FILTER(
        ALLEXCEPT('AR Results','Ar Results'[Tech Type]),
        'AR Results'[DeliveryYearNum] <= MAX('AR Results'[DeliveryYearNum])
        
    ) , 'Ar Results'[Tech Type] in VALUES(Techtype[Tech Type])
)

 

Has you can see below the calculations are now matching with cumulative bottom chart is your measure top one is the corrected one on the top chart replace the tech type by the disconnected table values

 

MFelix_1-1767874887887.png

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



danextian
Super User
Super User

Are you by chance using a column from a different table in your x-axis? If not, can you please post a sanitized copy of your pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

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.