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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Get Latest Entry

Hey everyone, 

I have a new problem to solve. My data looks like this:

SerialnumberLastModifiedProductID
1345671. 2. 2020THXY22
18699991. 2. 2020THXY22
3475841. 2. 2020THXY22
1777774. 2. 2020THXY24
1788887. 6. 2020THXY24
3899994. 2. 2020THXY24
18888810. 2. 2020THXY26
183344510. 2. 2020THXY26
18555554. 3. 2020THXY26
37777710. 2. 2020THXY26


I have a table of products (with a lot more rows and columns) which can be identified by their ProductIDs. These products have multiple single parts, which can be identified by their Serialnumbers. If one of those single parts are exchanged or updated, then a new row with the ProductID, the Serialnumber of the new part and the date (LastModified) when the part was updated or exchanged gets created in the table. So in the above example the product with the ID THXY24 had the part with the serialnumber 1xxxxx replaced on 7. 6. 2020. The row with the old part from 4. 2. 2020 remains in the table eventhough it is no longer relevant. 

My task is to filter the table and to remove the rows of parts which were updated. So in the above example I want to remove the rows corresponding to 178888 and the row corresponding to 1855555 but I am completely stuck. I have tried to implement solutions like this one but I have not gotten far. 

The only relevant part of the serialnumbers are the first two digits (the red ones). These identify the part and the rest give a description of it. There are only a set amount of numbers which could be in the first two digits (numbers like 1, 3, 5, 18, and a few more) so I could try to use them in the filter but I don't know how. 

Any help would be greatly appreciated! Thanks.

1 ACCEPTED SOLUTION

@Anonymous , I would prefer to create these two columns and old is that can be deleted

 

 

Key = right([Serialnumber], len([Serialnumber])-5)

new column =
if([LastModified]= maxx(filter(table , [Key] = earlier([Key]) && [ProductID] = earlier([ProductID])),[LastModified]) ,"Latest","Old")

 

See if this works for you

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

Create a Table

 

Table1 =
SUMMARIZE (
    Table,
    Table[Product id],
    "LAST Date", LASTNONBLANKVALUE (
        Table[Last Modified],
        MAX ( Table[Last Modified] )
    ),
    "Serial No", LASTNONBLANKVALUE (
        Table[Last Modified],
        MAX ( Table[Serial No] )
    )
)

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

amitchandak
Super User
Super User

@Anonymous , Logic to identify, what relaced what is still not clear to me. Can you explain with an example 

 

There are options, but they might not work for you

https://www.youtube.com/watch?v=rqDdnNxSgHQ

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hey @amitchandak, I'm sorry, my question could have been formulated clearer. 

I have the above table. The product with the ID THXY24 has two rows with serialnumbers starting with 1xxxxx. One of them was last modified on 4. 2. 2020 (the old one) and one was last modified on 7. 6. 2020 (the new one). In this case whatever part is identified by the serialnumber 1xxxxx was replaced on 7. 6. 2020. 

I now want to get rid of the row corresponding to the product ID THXY24 with the serialnumber 1xxxxx which was last modified on 4. 2. 2020, as it is currently not in use anymore. 

Similarly the product with the ID THXY26 has two rows with serialnumbers starting with 18xxxxx. One of them was last modified on 10. 2. 2020 (the old one) and one was last modified on 4. 3. 2020 (the new one). In this case whatever part is identified by the serialnumber 18xxxxx was replaced on 4. 3. 2020. I want to get rid of the row corresponding to the product ID THXY26 with the serialnumber 18xxxxx which was last modified on 10. 2. 2020 as it is no longer relevant. 

My problem is that I can't figure out how to filter out the older, irrelevant rows to delete them afterwards.

I hope this made my question clearer.

@Anonymous , I would prefer to create these two columns and old is that can be deleted

 

 

Key = right([Serialnumber], len([Serialnumber])-5)

new column =
if([LastModified]= maxx(filter(table , [Key] = earlier([Key]) && [ProductID] = earlier([ProductID])),[LastModified]) ,"Latest","Old")

 

See if this works for you

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Once again you've helped me a lot. Thank you!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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