Forum Discussion
powerbi remove newest time duplicates
- 2 years ago
Tinus1905 open Blad1 in Advanced Editor and replace everything with the following:
let Source = Excel.Workbook(File.Contents("\\dc01\Users\martijnb\Desktop\Hours 2.xlsx"), null, true), Blad1_Sheet = Source{[Item="Blad1",Kind="Sheet"]}[Data], #"Promoted Headers" = Table.PromoteHeaders(Blad1_Sheet, [PromoteAllScalars=true]), #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date added", type datetime}, {"Workdate", type date}, {"Name", type text}, {"Starttime", type time}, {"endtime", type time}, {"total changed by manager", type time}, {"Namecode", type text}, {"Factory", type text}}), g = Table.Group(#"Changed Type", {"Workdate", "Name", "Starttime"}, {{"all", each Table.LastN(Table.Sort(_, "Workdate"), 1)}}), combine = Table.Combine(g[all]) in combine
Tinus1905
Copy your Excel data and paste it in your reply to this message so we can use it to test the solution.
Is this ok?
- Fowmy2 years agoSuper User
Tinus1905
No, you have pasted a picture.
Sharing a dummy Power BI file representing your scenario would be beneficial. You can save the Power BI file or the Excel file on Google Drive or any other cloud storage platform and provide the link here. Kindly ensure that permission is granted to open the file.- Tinus19052 years agoResolver I
- AlienSx2 years agoSuper User
Tinus1905 requests access to your file... Group by name, workday, starttime (maybe + endtime). Sort each group by date added and take either first or last row (Table.FirstN or Table.LastN) depending on sorting order.
Table.Group(tbl_name, {"Workdate", ..., "endtime"}, {"groups", each Table.LastN(Table.Sort(_, "Date added"), 1) and then combine groups into new table: Table.Combine(step_above[groups])