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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Daxtothemax
Helper I
Helper I

Count of Closed Tasks

I'm looking for a DAX formula to count when a task changes from Open to Closed.  I only need the task to be counted Closed once on the day it was closed.  The closed tasks will remaining in the data set.  Example data below, any help is greatly appreciated!

 

Daxtothemax_0-1643729836659.png

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Daxtothemax That's because I wrote it with a syntax error apparently:

VAR __MinClosedDate = MINX(FILTER('Table',[Task] = __Task && [Status] = "Closed"),[Date])



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

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

@Daxtothemax That's because I wrote it with a syntax error apparently:

VAR __MinClosedDate = MINX(FILTER('Table',[Task] = __Task && [Status] = "Closed"),[Date])



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

@Daxtothemax Try something like:

Count of Closed Column =
  VAR __Task = [Task]
  VAR __Date = [Date]
  VAR __Status = [Status]
  VAR __MinClosedDate = MINX(FILTER('Table',[Task] = __Task) && [Status] = "Closed"),[Date])
RETURN
  IF(__Date = __MinClosedDate && [Status] = "Closed",1,BLANK())


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

Thank you for the response @Greg_Deckler .  I'm getting an error on this part for some reason. 

VAR __MinClosedDate = MINX(FILTER('Table',[Task] = __Task) && [Status] = "Closed"),[Date])

 

Any ideas why this would occur?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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