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 total in stacked bar graph

Hello,

 

I'm trying to create a graph that adds the cumulative total (new users) of a column over each month and moreover to split each bar by categorie of Entity. The data set is from August 2020 until now.

 

For now I used the cumulative yearly in the formulas given by PowerBI and I got this:

minhhai91_0-1620122274209.png

 

 

With the measure: 

 

Cumulative year to date of Number of User =

IF(

    ISFILTERED('UserSinceTable'[User since (MMYYYY)]),

    ERROR("Time Intelligence quick metrics can be grouped or filtered only by the date hierarchy or main date columns provided by Power BI."),

    TOTALYTD([Number of User], 'UserSinceTable'[User since (MMYYYY)].[Date])

)

 

The problem is that it resets at the beginning of each year and I'm searching a continuous accumulation over several years like that: 

 

 

minhhai91_1-1620122274216.png

 

Any help would be appreciated, thank you!

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please check the below picture and the sample pbix file's link down below.

 

Picture8.png

 

User count cumulate =
CALCULATE (
[users count],
FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) )
)
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

8 REPLIES 8
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please check the below picture and the sample pbix file's link down below.

 

Picture8.png

 

User count cumulate =
CALCULATE (
[users count],
FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) )
)
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Anonymous
Not applicable

Hi, thanks for the quick reply.

 

When I used your solution, I got this: 

 

minhhai91_0-1620201657272.png

 

with this formula:

Cumulate =

CALCULATE (

[Number of User],

FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) )

)

 

and Number of User = COUNT('Contact List'[User since (MMYYYY)])

 

I didn't use COUNTROWS(Data) here because several raws don't have to be count in my excel file.

 

Do you know how to correct this please.

 

Regards

 

Frédéric

Hi, @Anonymous 

Thank you for your feedback.

Please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.

Thank you.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Here is my data file screenshot.  

RaviKanth_0-1622822414719.png

 

Hi Jihwan Kim, when I used your solution, I am still not getting the cumulative stacked bar correctly. When I don't include category in Legends section, cumulative is coming up correctly. But, as soon as I add "Category" field, stacked bar is breaking.Screenshot 2021-06-04 115251.jpg

I am facing the same issue too. May I know how can we resolve this issue?

Anonymous
Not applicable

Hello, @Jihwan_Kim ,

 

It finally worked! 

 

Thank's so much

 

Frédéric

Anonymous
Not applicable

Here is my sample data:

 

minhhai91_0-1620122344921.png

 

Frédéric

 

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.