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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Cumulative totals in Stacked column chart over time by OS group

Hi Everyone,

I have been asked to create a few stacked column charts showing the cumulative total number of devices by their operating system group and over time (One chart spanning several years and another spanning over the months of a given year).

Sample data for the table is below:

OS (Groups) - which I manually created using the new group function in BI

DeviceCount - which I manually created with each record having a value of one. I thought it might be easier to use SUM on this Column instead of Count on rows (I am a n00b to Power BI so I don't know any better. 🤔)

 

Pic1.png

 

I created the following new measure:

Pic2.png

This works for some of the date periods but not all - it looks like it does not bring accross the cumulated data if the Operating System does not have a single installation date in the given period.

 

These are the two graphs I am working on.

Pic3.png

You can see the Windows 8 systems dissappear in 2019 and the Windows 7 systems dissapear in 2020 even though we did have some devices with these OS at the given time.

Pic4.png

It is even more obvious in this chart when looking at it Month to Month.

 

Any help would be greatly appreciated. Thanks in advance.

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @Anonymous , 

You could refer to my sample for details.

Best Regards,
Zoe Zhi

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

8 REPLIES 8
Anonymous
Not applicable

Hi @dax 

 

Its worked. Thanks for your assistance.

I am adding the measures for quick reference for anyone else who is interested.

 

Measure for Year by Year  Cumulative

Measure 6 = CALCULATE(SUM(table[count]), FILTER(ALLEXCEPT(table,table[os]), YEAR(table[date])<=MIN('calendar'[Date].[Year])))

 

Measure for Month by Month Cumulative

Measure 9 = CALCULATE(SUM(table[count]), FILTER(ALLSELECTED('calendar'[Date]),'calendar'[Date]<=MIN('calendar'[Date])))
 
dax
Community Support
Community Support

Hi @Anonymous,

Thank you for your sharing!

Best Regards,
Zoe Zhi

Anonymous
Not applicable

Hi @dax 

 

I just figured out why the icon was missing. The Auto date/time option was disabled for my pbix file. I will try to recreate your Calendar table and let you know my progress.

 

 

Pragati11
Super User
Super User

Hi,

 

Can you try this without creating any measure? Just drag the relevant fields to staked chart visual. Options are shown in screenshot attachedtest.png.

 

Thanks.

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi @Pragati11 

 

Sorry but it didnt work. It sums the totals for the given year/month but not all of the previous periods.

dax
Community Support
Community Support

Hi @Anonymous , 

You could refer to my sample for details.

Best Regards,
Zoe Zhi

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

Anonymous
Not applicable

Hi @dax 

 

Your pbix looks to be exactly what I wanted.

 

However I ran into an issue when trying to recreate the measure. On my dashboard, it does not like the filter  - specifically  'calendar'[Date].[Year]

I believe it has to do with the way I manually created my Calendar table. In the Fields section, I dont seem to have the Calendar icon next to the Date column. I tried to recreate your Calendar table but with no success. How have you managed to create the Date Hierarchy without having any Year, Quarter, Month columns in your table?

 

I think if I can create the Calendar table and Date Hierarchy the same as yours, my original issue will be resolved.

 

Once again, thanks in advance.

Hi, @Anonymous 

 

I tried using a sample data as you mentioned in your query. It works for me. Can you attach your sample data please which is showing you issues?

 

Thanks.

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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