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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

MTD cumulative count on the number of dates for each month

I need a count of the number of dates in column 'CWOrdered' where date is <= to the data point (date axis) in a line graph to get a cumulative graph or MTD. I have a separate date table called 'Date' for the timeline in my graphs.

 

CwOrdered     MTD
2016-01-05     1
2016-01-15     2
2016-02-24     3
2016-03-20     4
2016-04-10     5
2016-05-35     6
etc. so that January 2016 = 2 February 2016 = 3 and so forth

 

 

I'm guessing it could be done with a simple count on the number of dates of the coulumn until the date where it is displayed in the line graph but I can't seem to get it working.

If I just add it to the graph I get the count of 'CWOrdered' as a straight line in the graph which isn't very helpful 😃

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

Should be something along the lines of:

 

Measure = 
VAR __maxDate = MAX('Calendar'[Date])
VAR __table = FILTER(ALL('Table'),[CwOrdered]<=__maxDate)
RETURN
COUNTX(__table,[CwOrdered])

Alos, check out my Time Intelligence the Hard Way:

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



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...

View solution in original post

v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Could you please mark the proper answers as solutions?

 

 

Best Regards,

Community Support Team _ Dale
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

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Could you please mark the proper answers as solutions?

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
Community Champion

Should be something along the lines of:

 

Measure = 
VAR __maxDate = MAX('Calendar'[Date])
VAR __table = FILTER(ALL('Table'),[CwOrdered]<=__maxDate)
RETURN
COUNTX(__table,[CwOrdered])

Alos, check out my Time Intelligence the Hard Way:

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



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...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors