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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Date Diff and group

Hi,

 

I'm trying to work out how many records are out of target by using a datediff.

 

I have the target date and im going to use TODAY. The idea is that if Today's date is greater than the target date it is overdue. 

 

My question is how would i group those results after the date dif?

 

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

I create an example.

IDOpen DateTarget Date
111/1/201911/19/2019
211/2/201911/21/2019
311/3/201911/18/2019
411/4/201911/20/2019
511/5/201911/22/2019
611/6/201911/30/2019

Create measures like so:

 

IsOverdue = IF ( TODAY () > MAX ( 'Table'[Target Date] ), 1, 0 )
Count of IsOverdue = SUMX ( 'Table', [IsOverdue] )

 

overdue1.PNG

Or, you can create measures like so:

 

DateDiff of Day = DATEDIFF ( MAX ( 'Table'[Target Date] ), TODAY (), DAY )
IsOverdue 2 = IF ( [DateDiff of Day] > 0, 1, 0 )
Count of IsOverdue 2 = SUMX ( 'Table', [IsOverdue 2] )

 

overdue2.PNG

 

Best Regards,

Icey

 

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

4 REPLIES 4
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous ,

 

did you solve your problem?


If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Icey
Community Support
Community Support

Hi @Anonymous ,

I create an example.

IDOpen DateTarget Date
111/1/201911/19/2019
211/2/201911/21/2019
311/3/201911/18/2019
411/4/201911/20/2019
511/5/201911/22/2019
611/6/201911/30/2019

Create measures like so:

 

IsOverdue = IF ( TODAY () > MAX ( 'Table'[Target Date] ), 1, 0 )
Count of IsOverdue = SUMX ( 'Table', [IsOverdue] )

 

overdue1.PNG

Or, you can create measures like so:

 

DateDiff of Day = DATEDIFF ( MAX ( 'Table'[Target Date] ), TODAY (), DAY )
IsOverdue 2 = IF ( [DateDiff of Day] > 0, 1, 0 )
Count of IsOverdue 2 = SUMX ( 'Table', [IsOverdue 2] )

 

overdue2.PNG

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous ,

 

create a calculated column (New column) with the overdue calculation.

Then you can treat the column like any other column.

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous ,

 

i think you want something like this

 

DaysOverdue =
VAR Due =
    DATEDIFF ( 'Table'[Date]; TODAY ()DAY )
RETURN
    IF ( Due > 0DueBLANK () )

 

Overdue.png

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


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