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! Learn more

Reply
AMZA
New Member

Find max date within groups and count unique records if date is overdue

Hello everyone,

 

I am looking to calculate number of unique people (ID) who's review date is overdue. And I am looking for dynamic formula which calculates on the fly and does not pick column D or E in calculation (as I have date based filters)

 

The calculation goes as follows:

- Get latest joining or review date for each person (Max of column B or C) = Answer column D

- Calculate next review date i.e. column D plus 1 month = Answer column E

- Calculate number of people who's date is overdue i.e. column F = Answer 3

 

As mentioned please suggest dynamic formula as rows can vary based on filter section. I spent couple of hours around this but couldn't achieve desired result. Thanks for your help

 

For reporting today's date is: 10-Feb-23

ABCDEF
IDJoiningdateReviewdateLatestJoining&ReviewDateNextReviewDate (+1 month)Overdue
111-Jan-23 11-Jan-2311-Feb-23 
201-Jan-2302-Jan-2307-Jan-2307-Feb-23Yes
201-Jan-2304-Jan-2307-Jan-2307-Feb-23Yes
201-Jan-2307-Jan-2307-Jan-2307-Feb-23Yes
315-Dec-2218-Dec-2225-Dec-2225-Jan-23Yes
315-Dec-2225-Dec-2225-Dec-2225-Jan-23Yes
401-Dec-2215-Dec-2220-Dec-2220-Jan-23Yes
401-Dec-2220-Dec-2220-Dec-2220-Jan-23Yes
501-Dec-2212-Jan-2312-Jan-2312-Feb-23 
      
    Answer3 people
1 ACCEPTED SOLUTION
ppm1
Solution Sage
Solution Sage

Here's one way to do it in a measure expression that only needs your ID, JoiningDate and ReviewDate columns. I added count of ID column just to show the rows that don't get counted. See correct value of 3 in total (not sure what fields you plan to use in your visual). Note that I used a hardcoded date as requested, but you could use a dynamic one easily too.

 

ppm1_1-1676035476876.png

 

People Overdue =
VAR ac =
    ADDCOLUMNS (
        T1,
        "cNextReview", EDATE ( MAX ( T1[Joiningdate], T1[Reviewdate] ), 1 )
    )
VAR overdue =
    FILTER ( ac, [cNextReview] < DATE ( 2023, 2, 10 ) )
RETURN
    COUNTROWS ( SUMMARIZE ( overdue, T1[ID] ) )

 

Pat

 

Microsoft Employee

View solution in original post

2 REPLIES 2
AMZA
New Member

Hi Pat,

 

This seems to be in right direction. I was looking for logic flow and your answer makes sense. I will make date dynamic and then it should be good. 

 

Thanks

ppm1
Solution Sage
Solution Sage

Here's one way to do it in a measure expression that only needs your ID, JoiningDate and ReviewDate columns. I added count of ID column just to show the rows that don't get counted. See correct value of 3 in total (not sure what fields you plan to use in your visual). Note that I used a hardcoded date as requested, but you could use a dynamic one easily too.

 

ppm1_1-1676035476876.png

 

People Overdue =
VAR ac =
    ADDCOLUMNS (
        T1,
        "cNextReview", EDATE ( MAX ( T1[Joiningdate], T1[Reviewdate] ), 1 )
    )
VAR overdue =
    FILTER ( ac, [cNextReview] < DATE ( 2023, 2, 10 ) )
RETURN
    COUNTROWS ( SUMMARIZE ( overdue, T1[ID] ) )

 

Pat

 

Microsoft Employee

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.