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

Creating a cumulative bar chart with additional categories

So i have basically done what is asked for in this post but as a bar chart:
https://community.fabric.microsoft.com/t5/Desktop/Problems-with-formula-for-creating-cumulative-coun...
This works for me

Now in my table are multiple subcategories for each entry which i also want to include in the visual.
For example if my table looked like this:

DateTotalMonthlyAmountSubcategoryRuntimeMonths
Jan 22404Dep 110
Jan 22363Dep 312
Feb 22555Dep 211
Feb 22404Dep 110
Feb 22363Dep 312
Mar 22555Dep 211
Mar 22404Dep 110
Mar 22363Dep 312
Apr 22404Dep 110

(The total is also the key attribute)

The visual i currently have would be this:

mophi_0-1700837812173.png


But i want to see which department is responsible for which part of the monthly amount. So i try to add the subcategory as legend and this happens:

mophi_2-1700838059715.png

 

Since some departments dont have any impact in april the acumulated values also dont get added to the sum in april.
How can i always keep the complete cumulative value in each month and also show the subcategories?

If anyone could help it would be greatly appreciated!

1 ACCEPTED SOLUTION

Hi,

PBI file attached.

Ashish_Mathur_0-1703719805620.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

24 REPLIES 24
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1700963934911.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Yes this works but what if i have data that is in the future?
Currently the cumulative values are based on the DATESYTD function but what do i do as soon as i have data that is planned to be after the current year?

What problem are you facing because of dates that belong to the future years?  Share the download link of the file, show the problem clearly and the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Sorry for not clarifying.
So im talking about the same table but the dates of would not be of - like in my earlier example - 2022 but in 2025. Like this:

DateTotalMonthlyAmountSubcategoryRuntimeMonths
Jan 25404Dep 110
Jan 25363Dep 312
Feb 25555Dep 211
Feb 25404Dep 110
Feb 25363Dep 312
Mar 25555Dep 211
Mar 25404Dep 110
Mar 25363Dep 312
Apr 25404Dep 110


And the table is still supposed to look like the one you created but now were talking about 2025.

mophi_0-1701346306282.png

My solution should work irrespective of the year of the entries in the Date column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Whenever i change the year of the dates to 2025 the cumulative T measure doesnt do anything. It stays empty.

I used your pbi file and only changed the dates and it doesnt work.

I can help further only when i get access to the file.  Share the download link and the problem very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I recreated what you did in this file but with the changed date.
Now the edited version doesnt show the data for the acumulated values.
You can see what i mean here:

https://drive.google.com/file/d/1bHwAsEAM4Ry9AWiUIgcmSDF8iJdc8hNd/view?usp=drive_link
(Hope this link works)

Change the calendar table formula to

Calendar = CALENDAR(MIN(Data[Date]),MAX('Future Data'[Date]))

Hope this helps.

Ashish_Mathur_0-1701732931165.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Almost, this works when i have all the date in the same year what if one of the categories is in a different year? 
Like this:

mophi_0-1701942042066.png

Then this happens:

mophi_1-1701942078574.png
How do i make it add up the same way?

Share the download link of the PBI file with that specific dataset and my measures already written.  Show the problematic visual in that PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

Based on the data in the file, show the expected result in a Table format very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Sorry i messed up the data in the file i shared.
Here is a correct one:
https://drive.google.com/file/d/1bHwAsEAM4Ry9AWiUIgcmSDF8iJdc8hNd/view?usp=sharing

And this is what i need it to look like(with bars for each month instead of the three points of course):

mophi_1-1703540126875.png

So it always shows the accumulated monthly amount for each department and whenever there is an additional amount it just adds it to the amount of that department.
Also i might need it with a dynamic number of departments.

Thank you very much

 

I do not see 3 dots there.  Everything seems fine to me.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

The image i sent is not the finished graph but only an edited version of what i want it to look like. Thats why i said the 3 dots in the image are only because i didnt want to create a bar for the months between april 2025 and january 2026. For practical reasons but they should of course be in the final visual.

For Dep 3, information is available only for JFM 2026.  There if i swap Year and Month on the X-axis, this is the image i get (with which i see nothing wrong)

Ashish_Mathur_0-1703586239782.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Yes, but i need ALL of the monthly amount to be added up in every month after they are added.
In the ss you shared it resets after each year. I would like it to carry on the data from the previous years and departments.

Hi,

PBI file attached.

Ashish_Mathur_0-1703719805620.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Yes, thank you very much thats what i have been looking for.

Helpful resources

Announcements
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.

Users online (4,085)