Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
ConnorH
Microsoft Employee
Microsoft Employee

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.

1 ACCEPTED SOLUTION
W_G_Ryan
Helper I
Helper I

I'm not totally sure I follow the goal, but if you're familiar with Lag and Lead in SQL, is the idea that if there's a Lead value on the date, to leave the column blank?  If so I think this is what you're looking for.  Still new myself but I used this a while ago and I think this will work if I follow ask correctly:

https://community.powerbi.com/t5/Desktop/Lead-and-Lag-in-DAX/td-p/649162

View solution in original post

2 REPLIES 2
W_G_Ryan
Helper I
Helper I

I'm not totally sure I follow the goal, but if you're familiar with Lag and Lead in SQL, is the idea that if there's a Lead value on the date, to leave the column blank?  If so I think this is what you're looking for.  Still new myself but I used this a while ago and I think this will work if I follow ask correctly:

https://community.powerbi.com/t5/Desktop/Lead-and-Lag-in-DAX/td-p/649162

ConnorH
Microsoft Employee
Microsoft 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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.