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
Anonymous
Not applicable

Date Calculations for Last Entry Date

Hi All, Good day. I hope someone can help me with this scenario. I need to get the date difference in the column "Signoff date". Calculate only the date difference if the last user name is Change Analyst - Manila from its last signoff date. As you can see below sample, the last date is Mar 27 (last exit) which is changed by Change Analyst - Manila, so I need to get the date difference from the last entry date, which is Mar 22. If the last change is not by Change Analyst - Manila, no need for calculating the date difference.

katerinepr_0-1652248672129.png

 

1 ACCEPTED SOLUTION
Shishir22
Solution Sage
Solution Sage

Hello @Anonymous ,


Please try below calculated column-

 

Column =
VAR _MAxdate =
    CALCULATE (
        MAX ( Data[Signoff Date1] ),
        FILTER (
            Data,
            Data[Status] <> "Post Release Tasks"
                && Data[User Name] <> "Change Analyst - Manila [APAC - SSC]"
                && Data[Change Number] = EARLIER ( Data[Change Number] )
        )
    )
VAR _ManilaDate =
    CALCULATE (
        MAX ( Data[Signoff Date1] ),
        FILTER (
            Data,
            Data[User Name] = "Change Analyst - Manila [APAC - SSC]"
                && Data[Change Number] = EARLIER ( Data[Change Number] )
        )
    )
RETURN
    ABS ( DATEDIFF ( _ManilaDate, _MAxdate, DAY ) + 1 )

 

Please mark it as answer if it resolves your issue. Kudos are also appreciated.

 

 

Cheers,
Shishir

View solution in original post

3 REPLIES 3
Shishir22
Solution Sage
Solution Sage

Hello @Anonymous ,


Please try below calculated column-

 

Column =
VAR _MAxdate =
    CALCULATE (
        MAX ( Data[Signoff Date1] ),
        FILTER (
            Data,
            Data[Status] <> "Post Release Tasks"
                && Data[User Name] <> "Change Analyst - Manila [APAC - SSC]"
                && Data[Change Number] = EARLIER ( Data[Change Number] )
        )
    )
VAR _ManilaDate =
    CALCULATE (
        MAX ( Data[Signoff Date1] ),
        FILTER (
            Data,
            Data[User Name] = "Change Analyst - Manila [APAC - SSC]"
                && Data[Change Number] = EARLIER ( Data[Change Number] )
        )
    )
RETURN
    ABS ( DATEDIFF ( _ManilaDate, _MAxdate, DAY ) + 1 )

 

Please mark it as answer if it resolves your issue. Kudos are also appreciated.

 

 

Cheers,
Shishir
Shishir22
Solution Sage
Solution Sage

Hello @Anonymous ,


Can you please send data in tabular format instead of picture?

 

Also please send expected output.

 

 

Cheers,
Shishir
Anonymous
Not applicable

Hi Shishir, here's the tabular sample. 

Change NumberStatusStatus Entry DateUser NameUser RoleUser Add DateSignoff DateSignoff Date1Signoff DurationExpected Output
QCH00057911Approve Change06-Dec-2021 03:52:38 PM SGTMariaApprover06-Dec-2021 03:52:38 PM SGT07-Dec-2021 05:56:20 AM SGT12/7/20210 
QCH00057911Approve Change06-Dec-2021 03:52:38 PM SGTRebeccaApprover06-Dec-2021 03:52:38 PM SGT07-Dec-2021 07:11:11 AM SGT12/7/20210 
QCH00057911Approve Change06-Dec-2021 03:52:38 PM SGTAntonioApprover06-Dec-2021 03:52:38 PM SGT07-Dec-2021 08:07:46 AM SGT12/7/20210 
QCH00057911Collaborate10-Nov-2021 12:17:11 PM SGTChange Analyst - Manila [APAC - SSC]Acknowledger23-Nov-2021 08:43:48 AM SGT02-Dec-2021 03:19:10 PM SGT12/2/202176
QCH00057911Collaborate01-Oct-2021 09:19:23 AM SGTAntonioAcknowledger01-Oct-2021 09:19:23 AM SGT02-Oct-2021 12:37:15 PM SGT10/2/20210 
QCH00057911Collaborate01-Oct-2021 09:19:23 AM SGTMariaAcknowledger01-Oct-2021 09:19:23 AM SGT07-Oct-2021 05:17:22 AM SGT10/7/20213 
QCH00057911Collaborate10-Nov-2021 12:17:11 PM SGTAntonioAcknowledger10-Nov-2021 12:17:11 PM SGT10-Nov-2021 12:26:59 PM SGT11/10/20210 
QCH00057911Collaborate10-Nov-2021 12:17:11 PM SGTMariaAcknowledger10-Nov-2021 12:17:11 PM SGT22-Nov-2021 11:09:04 AM SGT11/22/20217 
QCH00057911Collaborate10-Nov-2021 12:17:11 PM SGTAU Training GroupAcknowledger10-Nov-2021 12:17:11 PM SGT25-Nov-2021 11:57:25 AM SGT11/25/202110 
QCH00057911Collaborate01-Oct-2021 09:19:23 AM SGTAU Training GroupAcknowledger01-Oct-2021 09:19:25 AM SGT  6 
QCH00057911Post Release Tasks07-Dec-2021 09:57:37 AM SGTSSC LMC AdminsAcknowledger07-Dec-2021 09:57:41 AM SGT07-Dec-2021 02:18:32 PM SGT12/7/20210 
QCH00064812Collaborate15-Mar-2022 03:50:29 PM SGTAU Training GroupAcknowledger15-Mar-2022 03:50:34 PM SGT16-Mar-2022 04:19:47 PM SGT3/16/202214
QCH00064812Collaborate15-Mar-2022 03:50:29 PM SGTPaulApprover15-Mar-2022 03:50:29 PM SGT16-Mar-2022 06:27:01 AM SGT3/16/202204
QCH00064812Collaborate15-Mar-2022 03:50:29 PM SGTWaiApprover15-Mar-2022 03:50:29 PM SGT16-Mar-2022 06:28:03 AM SGT3/16/202204
QCH00064812Collaborate15-Mar-2022 03:50:29 PM SGTMaheshApprover15-Mar-2022 03:50:29 PM SGT16-Mar-2022 11:30:19 AM SGT3/16/202204
QCH00064812Collaborate21-Mar-2022 04:35:32 PM SGTWaiAcknowledger21-Mar-2022 04:35:32 PM SGT22-Mar-2022 07:01:19 AM SGT3/22/202204
QCH00064812Collaborate21-Mar-2022 04:35:32 PM SGTPaulAcknowledger21-Mar-2022 04:35:32 PM SGT22-Mar-2022 08:26:19 AM SGT3/22/202204
QCH00064812Collaborate21-Mar-2022 04:35:32 PM SGTChange Analyst - Manila [APAC - SSC]Acknowledger21-Mar-2022 04:35:32 PM SGT27-Mar-2022 04:19:47 PM SGT3/27/202204


Expected output is date difference of below highlighted dates: Every Status has date difference

katerinepr_0-1652250447446.png

 

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.

Top Solution Authors