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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mjackson122
Regular Visitor

Count number of tasks due in x to y days

I have tried several formulas to return the correct number of tasks due within 30, 60, 90 days on a card visual. The formulas I've tried either return a blank or count all of the tasks. The scenario I am trying to fulfil is the following. I want to display the number of tasks due in up to 90 days on a card. The card formula should count tasks that are due within 61 and 90 days from today. I have one table with start, end dates, and days due. The card should also show a 0 instead of a blank if the results are 0. The formula should not count tasks with negative days due

 

Current formula

upcoming90 = CALCULATE(COUNT(LeadIndicators[End]),LeadIndicators[End]=TODAY()+90)
 
Sample Data
 
Start End Days Due
1/1/19 3/1/19 -18
1/1/19 6/15/19 88
1/1/19 4/15/19 27
1/1/19 2/25/19 22
1/1/19 6/15/19 88
1/1/19 3/1/19 -18
 
So for the upcoming 61-90 scenario I should get a return result of 2.
1 ACCEPTED SOLUTION

I disagree. See attached Page 5, Table 8

 

 


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

Probably should be something like:

 

upcoming90 = 
VAR __table = FILTER(ALL('LeadIndicators'),[End]>=TODAY()+60 && [End]<=TODAY()+90)
RETURN
COUNTX(__table,[End])

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks Greg, unfortunately that returned a value of 12 instead of 2.

I disagree. See attached Page 5, Table 8

 

 


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.