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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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
Community Champion
Community Champion

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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

 

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
Anonymous
Not applicable

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.