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
JKoivu
Helper I
Helper I

Get the count of overdue dates

Let's say I have this type of data:

JKoivu_1-1605533476302.png

 

I would like to get the count of events where the date is overdue. Let's assume that today's date is 2020-11-10, and all dates older than 10 days are considered overdue, so in this example that would be only vehicle #2. I have tried a measure like this:

 

Overdue count =
VAR maxDate = CALCULATE(
  MAX(Events[date]),
  ALLEXCEPT(Events, Events[event_id])
)

RETURN COUNTROWS(
  FILTER(
    Events,
    Events[date] = maxDate && DATEDIFF(maxDate, NOW(), DAY) > 10
  )
)

 

 But it doesn't seem to show the proper value, instead it's blank.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@JKoivu , Try a measure like 

countx(filter(summarize(Table, Table[event_id], "_1", count(Table[event_id]), "_2", calculate(count(Table[event_id]), filter(Table, Table[Date]<today()-10))), [_1]<> [_2]),[event_id])

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@JKoivu , Try a measure like 

countx(filter(summarize(Table, Table[event_id], "_1", count(Table[event_id]), "_2", calculate(count(Table[event_id]), filter(Table, Table[Date]<today()-10))), [_1]<> [_2]),[event_id])

Thank you @amitchandak this really helped me! Though I had to change the [_1]<>[_2] to [_1] = [_2] in my case.

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.