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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
amehmood
Helper I
Helper I

cumulative count of counted text in a column

I would appreciate if you could assist me in the following.
 
I need a simple DAX for running the sum of counts of a column that contains the text.
 
I need to count, for instance, "Medium" from a column titled Level and then create a running sum of the counts. The expected visual counts by month for various years as a bar chart and as a line cumulative of counts by month.
 
I hope you would be able to help.
 
Thanks,
5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

So a running total is generally constructed along the lines of

 

Measure =

  VAR __Date = MAX('Table[Date])

  COUNTROWS(

    FILTER('Table',[Level] = "Medium" && 'Table'[Date] <= __Date)

  )

 

Column would be:

Column =

  VAR __Date = [Date]

  COUNTROWS(

    FILTER('Table',[Level] = "Medium" && 'Table'[Date] <= __Date)

  )

 

But sample data would help to make sure. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

 

Thanks Greg

 

Unfortunately still struggling........

 

not sure about "  __Date)"   what this underscore line refers to? and "'Table'[Date] " here the date column is from the same table,

 

Can you pls one more assist, thanks

 

Following is the sample of data, again,

 

IDYearlevelDate
1141900024002019Medium9/7/2019
1141900024202019serious9/10/2019
1141900024402019Medium9/14/2019
1141900024402019light9/14/2019
1141900024602019Medium9/17/2019
1151900002602019light9/24/2019
1141900024612019Medium9/17/2019
1141900024802019Medium9/19/2019
1161900044802019Medium6/7/2019
1161900044802019Medium6/7/2019
1161900044802019Medium6/7/2019
1161900044802019Medium6/7/2019
1161900044802019Medium6/7/2019
1161900044802019light6/7/2019
1161900044802019Medium6/7/2019
1161900044802019Medium6/7/2019
1161900044812019Medium6/8/2019
1161800018812018Medium3/19/2018
1161800018812018Medium3/19/2018
1161800018812018Medium3/19/2018
1161800018812018death3/19/2018
1161800018812018Medium3/19/2018
1151800003202018Medium3/21/2018
1161800019202018light3/20/2018
1161800019402018Medium3/21/2018
1161800019802018death3/21/2018
1161800019802018Medium3/21/2018
1011800000802018light3/16/2018
1011800000802018light3/16/2018
1161800019612018Medium3/21/2018
1141800008002018Medium3/22/2018
1161800019602018Medium3/21/2018
1161800019812018light3/21/2018
1161800019822018Medium3/21/2018
1161800019832018serious3/21/2018
1141800007802018Medium3/20/2018
1141800009202018Medium4/12/2018
1161800022402018Medium4/12/2018
2011800010802018Medium4/13/2018
1121800004002018light4/12/2018
1121800004002018Medium4/12/2018
3021800000802018death3/20/2018
3021800000802018serious3/20/2018
3021800000802018death3/20/2018

Hi

 

I tried the following  

 

measure 2 =
countrows(Filter( (data), data[level]="Death" && data[Date] <= MAX (data[Date]))
)
 
The above seems ok but not sure the error from following: too fee arguments are passed through filters.......
 
Column =
Countrows (FILTER(data), data[level]="death" && data[Date] <= MAX (data[Date])
)
 
please assist. 

You should delete the parentheses around data in your Filter.

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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