Forum Discussion

bvilten's avatar
bvilten
Icon for Helper III rankHelper III
7 years ago

Need help with DAX formula

Hello All,

I have a table as follows ( the actual table is thousands of records, and UserIDs may appear many times with different contract end dates). There are only 3 options for the Action column.

 

UserID  ContractEndDate       Action                        IsExpired

8888      1/1/2019                  Onboard                    True

8888      1/1/2019                  Offboard                    True

8888      1/1/2019                  Contract Extension     True

 

I have found the latest contract end date and determined if it is true or not. What I need to do now is determine if the UserID with the expired contract end date (CED) has an action of Offboard in one of the CED records. If it does not then that UserID should be sent to a calculated table for reporting.

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi bvilten 
    Not sure I get you.

    But, one option is to create a flag column and then filter according to it.

    Column = if(Table1[Action] = "Offboard",1,0)

     

    Then:

    • bvilten's avatar
      bvilten
      Icon for Helper III rankHelper III

      Hello Anonymous ,

       

      Thank you for responding. I'm not surprised you aren't getting me. I'm not sure my self ;-). Let me try again. What I am trying to get at is this.

       

      Find all records for each d#, find each of last contract end date, search for "offboard" action within records containing last contract end date. If not found and last contract end date is expired then report record.

      • bvilten's avatar
        bvilten
        Icon for Helper III rankHelper III

        I have come up with the following formula:

         

        ToBeChecked = IF(AND(OnOffboardingManagement[IsCEDExpired] = TRUE, ISBLANK(OnOffboardingManagement[ActualEndDate])),"Check","Varified")

        Which works to a point. The problem is that I have both a record that fits the check scenerio, and a record that fits the Varified scenerio. If I get a hit on Varified then all other records for that UserID should be skipped.