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
MahamoodBi
Frequent Visitor

How to filter Termination date(last date)

Hi Power bi experts,

I need to find out Termination date in below table,i have 3 records (i.e Action Type - D1, EE,ES this are employees last date )
i need these three data in the separate Termination Column, could you please suggest a calculated column and  also need to aplly filter Action Type {"D1", "EE","ES"}

MahamoodBi_0-1661442306229.png

my output will like

 

MahamoodBi_1-1661442358607.png

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

@MahamoodBi 

Please try

Termination Date =
VAR CurrentDate = TableName[Action Date]
VAR TerminationDate =
    CALCULATE (
        MAX ( TableName[Action Date] ),
        ALLEXCEPT ( TableName, TableName[Emp.No] ),
        TableName[Action Type] IN { "D1", "EE", "ES" }
    )
RETURN
    IF ( CurrentDate = TerminationDate, TerminationDate )

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

@MahamoodBi 

Please try

Termination Date =
VAR CurrentDate = TableName[Action Date]
VAR TerminationDate =
    CALCULATE (
        MAX ( TableName[Action Date] ),
        ALLEXCEPT ( TableName, TableName[Emp.No] ),
        TableName[Action Type] IN { "D1", "EE", "ES" }
    )
RETURN
    IF ( CurrentDate = TerminationDate, TerminationDate )

@tamerj1  i am getting error in below code

MahamoodBi_1-1661510613395.png

could you please suggest.

@MahamoodBi 
Seems you have two fact tables. Please provide details about yuor data model and relationships.

Thank you @tamerj1  ,now dax functions is working.

MahamoodBi_0-1661504618468.png

 

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.

Top Solution Authors