Forum Discussion

ConnorH's avatar
ConnorH
Icon for Microsoft Employee rankMicrosoft Employee
5 years ago
Solved

Filtering a table to a new table

I am not really sure how to go about an issue I came across. 

 

I have a table called status containing columns such as:

Project IDStatus ExtractStatus Change DateCreated date
135683.07/15/207/10/20
135684.07/16/207/10/20
155981.07/18/207/16/20
155982.07/20/207/16/20
135683.07/20/207/10/20
137724.07/30/207/10/20

 

I am trying to filter this table into another table or create another column in this table which will allow me to filter out blanks. The project may have the same status twice but my goal is to have a project with no duplicate status and take the most recent date for the status changed date.

 

So a a custom column would look like this. Where the first row with the new column is left blank because there is a more recent date for that status with that project ID.

 

Project IDStatus ExtractStatus Change DateCreated dateEdit Status Change Date
135683.07/15/207/10/20 
135684.07/16/207/10/207/16/20
155981.07/18/207/16/207/18/20
155982.07/20/207/16/207/20/20
135683.07/20/207/10/207/20/20

 

My other idea fold be to somehow pull this data into a new table with a filter but I don't now how I would do that.

2 Replies

    • ConnorH's avatar
      ConnorH
      Icon for Microsoft Employee rankMicrosoft Employee

      I was able to pull the Latest date where ProjectID=ProjectID and Status=Status. I still do not know how to set this equation up to only keep one value per status per project ID.

       

      ProjectIDStatus ExtractModifiedLast Status Date (New column)
      346312.16/1/20 
      346312.16/4/206/4/20
      346314.06/20/206/20/20

       

      "Last status date =
      var _ProjectID = 'Status'[ProjectID]
      var _Status = 'Status'[Status Extract]
      Var _StatusDate = 'Status'[Modified]
      var _LaterDate = MAXX(FILTER('Status','Status'[ProjectID] = _ProjectID && 'Status'[Status Extract] = _Status), 'Status'[Modified])

      Return _LaterDate"
       
       
      this equation will make the table like this:
      ProjectIDStatus ExtractModifiedLast Status Date (New column)
      346312.16/1/206/4/20
      346312.16/4/206/4/20
      346314.06/20/206/20/20