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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Cumulative Sum of sorted Count

Hi together,

 

I got following Problem:

I am trying to build the cumulative sum of a measure, which gives me the count of how often a value appears in my dataset.

This measure is sorted in my table view and starts with the biggest value first and ends with the lowest.

This is what i have:

Screenshot 2022-02-07 150030.png

 

This is, what i am looking for:

 

Screenshot 2022-02-07 151044.png

 

I tried several dax measures, but they all did not work, because the Count of message is already a measure and not just some values in a table.

Thank you!!

1 ACCEPTED SOLUTION
refint_650
Helper I
Helper I

@Anonymous 

 

this expression worked for me.

 

refint_650_0-1644349802402.png

 

View solution in original post

8 REPLIES 8
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

I did the test and favor @refint_650  response. If there is no effect of additional filters, the cumulative value can be found by the following two measures.

M_sum = COUNTROWS('Table')

1 = CALCULATE([M_sum],ALL('Table'),'Table'[Category]<=MAX('Table'[Category]))

vhenrykmstf_0-1644475529253.pngvhenrykmstf_1-1644475545646.png


Can you provide more information about the data model or check for possible filter conditions in the filter. Looking forward to your reply.


Best Regards,
Henry


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

refint_650
Helper I
Helper I

@Anonymous 

 

this expression worked for me.

 

refint_650_0-1644349802402.png

 

refint_650
Helper I
Helper I

@Anonymous 

I 'm through same issue, seem there is no straight way to calculate  running or cumulative total.

do counts 1st and 2nd step apply sum based on year/month.  gotta reseach more

vs

parry2k
Super User
Super User

@Anonymous I need to look at how your model is and what you are using on rows? Are you using columns on the rows from the same table on which you have countrows measure.

 

Check by changing ALL ( Table[Message] ) to ALL ( Table )

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

 

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k my table contains a lot of rows. One of the columns of this table is 'message'. There are about 200 different messages in some of this rows, some of them are also blank. The measure, which counts how much of these individually messages appear in my table is simply: COUNT(Table[Message]). This is what you can see in the colums 'Count of Message'. So i am just working with one table..

parry2k
Super User
Super User

@Anonymous try this measure

 

RT = 
VAR __cnt = [Count]
RETURN
CALCULATE ( [Count], FILTER ( ALL ('Table'[Message] ), [Count] <= __cnt ) )

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Thanks for your suggestion @parry2k .

Unfortunately this measure gives me the exact same values as the count-function.

Screenshot 2022-02-07 174139.png

 

Regards, Lennart.

@Anonymous 

 

can you show sample data view for this one in picture format. i guess you have to change filter condition . can you put rough data in excel and share picture.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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