Reply
mophi
Frequent Visitor
Partially syndicated - Outbound

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

Syndicated - Outbound

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

Syndicated - Outbound

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/

Syndicated - Outbound

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?

Syndicated - Outbound

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/

Syndicated - Outbound

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

Syndicated - Outbound

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/

Syndicated - Outbound

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.

Syndicated - Outbound

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/

Syndicated - Outbound

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)

Syndicated - Outbound

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/

Syndicated - Outbound

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?

Syndicated - Outbound

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/

Syndicated - Outbound

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/

Syndicated - Outbound

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

 

Syndicated - Outbound

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/

Syndicated - Outbound

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.

Syndicated - Outbound

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/

Syndicated - Outbound

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.

Syndicated - Outbound

Hi,

PBI file attached.

Ashish_Mathur_0-1703719805620.png

 


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

Syndicated - Outbound

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

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)