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! Request now

Reply
Anonymous
Not applicable

Remove Rows based on date

I can't find anything exactly like what I'm trying to accomplish, so I need a bit of help.

 

I have a data set where I have some problem children that i need to remove from the data set entirely.

 

I need to keep the most recent date for each status and ID.

 

here's what they look like:

 

 

ID1

Status1Date1
ID1Status1Date2
ID1Status1Date3
ID1Status2Date4
ID1Status2Date5
ID1Status2Date6
ID2Status1Date7
ID2Status1Date8
ID2Status1Date9
ID2Status2Date10
ID2Status2Date11

 

Desired State:

 

ID1Status1Date3
ID1Status2Date6
ID2Status1Date9
ID2Status2Date11

 

Thanks!

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Anonymous 

create new calculated table

Table 2 = 
FILTER(
ADDCOLUMNS('Table', "Rank", RANKX(FILTER('Table', 'Table'[Status]=EARLIER('Table'[Status]) && 'Table'[ID]=EARLIER('Table'[ID])),'Table'[Date],,DESC)),
[Rank]=1
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

3 REPLIES 3
az38
Community Champion
Community Champion

Hi @Anonymous 

create new calculated table

Table 2 = 
FILTER(
ADDCOLUMNS('Table', "Rank", RANKX(FILTER('Table', 'Table'[Status]=EARLIER('Table'[Status]) && 'Table'[ID]=EARLIER('Table'[ID])),'Table'[Date],,DESC)),
[Rank]=1
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Nailed it.  You're my new hero.

 

😁

Anonymous
Not applicable

Also,

 

anyone with the same problem...

 

You'll need to recreate in the created table any calculated columns (and I'm assuming measures) that you had already created in the original table.  otherwise you may have bad data if you were pulling from one of the rows that got removed.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors