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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Removing Duplicate with different date format

Hello Everyone,

 

Before anything, here's some of the details you may need to know:

My Steps:

aku_0-1597858864118.png

Content of Remove Duplicates1:

 

 

= Table.Distinct(#"Appended Query", {"Survey Date"})

 

 

My Table after doing Filtered Rows1:

aku_0-1598109557491.png

 

 

What I wanna have:

aku_1-1598109661107.png

 

 

What I did is to try and remove the duplicates based on ANI and Survey Date but it would appear that in this particular example the "Remove Duplcates1" didn't push through.

 

Upon looking at the dates, here's what I found on the following rows:

Row 1: 8/14/2020 9:02:14 PM

Row 2: 2020-08-14T21:02:13.9990000

 

Now looking at the table, they seem to share the same value but from the backend, they don't.

Can someone help me with fixing the format of my dates into m/d/yyyy h:mm:ss AM/PM? So that the Remove Duplicates function will only return one row?

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

Having this as text, I did this:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WstA3NNE3MjAyULC0MjCyMjRRCPBVitWJVgKJ6RpY6BqahBgZgqWM9SwtLQ2AQCk2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type datetime}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Changed Type",{{"Column1", type number}}),
    #"Rounded Off" = Table.TransformColumns(#"Changed Type1",{{"Column1", each Number.Round(_, 7), type number}}),
    #"Removed Duplicates" = Table.Distinct(#"Rounded Off")
in
    #"Removed Duplicates"


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

Having this as text, I did this:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WstA3NNE3MjAyULC0MjCyMjRRCPBVitWJVgKJ6RpY6BqahBgZgqWM9SwtLQ2AQCk2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type datetime}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Changed Type",{{"Column1", type number}}),
    #"Rounded Off" = Table.TransformColumns(#"Changed Type1",{{"Column1", each Number.Round(_, 7), type number}}),
    #"Removed Duplicates" = Table.Distinct(#"Rounded Off")
in
    #"Removed Duplicates"


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler 

 

I tried doing the steps you created with a duplicate column of survey date and here's the result:

 

Table (after applying the function you created for the survey date - I applied it on a column I duplicated but the problem still persist:

aku_0-1598109778906.png

 

 

What I'm expecting:

aku_1-1598109849300.png

 

 

Here's the raw values in table form:

Survey DateSurvey Date - Copy
8/14/2020 10:30:17 AM44057.4376968
8/14/2020 10:47:23 AM44057.4495718
2020-08-14T10:47:22.999000044057.4495717
2020-08-14T10:30:16.999000044057.4376967

 

Hi @Anonymous ,

 

You need to choose the column "ANI" and "Survey Date - Copy".

= Table.Distinct(#"Changed Type", {"ANI", "Survey Date - Copy"})

 

v-xuding-msft_0-1597897123453.png

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@Anonymous - Change your rounding to 5 decimal places versus 7



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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