+ Reply to Thread
Results 1 to 8 of 8

Replace duplicates with null by power query

  1. #1
    Registered User
    Join Date
    08-27-2015
    Location
    kuwait
    MS-Off Ver
    Office 365
    Posts
    31

    Replace duplicates with null by power query

    I have two tables and after merging them through power query, some of the data in cells duplicate. I need to replace these duplicates with null so that the final output table is clean. if anyone can suggest steps in power query to get the outcome.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Replace duplicates with null by power query

    Not in power query.

    you can use the formula for

    O2 =IF(COUNTIF($J$2:$J2,$J2)>1,"delete","")
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,150

    Re: Replace duplicates with null by power query

    @siddiqsh;

    It seems that, you are making a "Left Join" on ID's of the 2 tables .... and you are getting the expected results.

    So, what is your actual goal in this process?

    Is something like shown in the below image will be OK for you?
    Attached Images Attached Images
    Last edited by Haluk; 07-19-2020 at 08:08 AM.

  4. #4
    Registered User
    Join Date
    08-27-2015
    Location
    kuwait
    MS-Off Ver
    Office 365
    Posts
    31

    Re: Replace duplicates with null by power query

    Quote Originally Posted by Haluk View Post
    @siddiqsh;

    It seems that, you are making a "Left Join" on ID's of the 2 tables .... and you are getting the expected results.

    So, what is your actual goal in this process?

    Is something like shown in the below image will be OK for you?
    thanks for your response. No it will not help. the results which I get by merging tables (attached excel sheet) is the desired one. only problem is repetitive values. I prefer solution through power query.

  5. #5
    Registered User
    Join Date
    08-27-2015
    Location
    kuwait
    MS-Off Ver
    Office 365
    Posts
    31

    Re: Replace duplicates with null by power query

    Quote Originally Posted by oeldere View Post
    Not in power query.

    you can use the formula for

    O2 =IF(COUNTIF($J$2:$J2,$J2)>1,"delete","")
    thanks for your response, I am looking for solution though power query if possible.

  6. #6
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,150

    Re: Replace duplicates with null by power query

    @siddiqsh;

    The image I posted in my message #3 is the result of a "Microsoft Query" and your "PQ table" can also be prepared in the same manner.

    But; as the results are not unique, the output is not the way you want.

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Replace duplicates with null by power query

    Please try

    Please Login or Register  to view this content.
    IMHO leave null data is really bad idea for database.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    08-27-2015
    Location
    kuwait
    MS-Off Ver
    Office 365
    Posts
    31

    Re: Replace duplicates with null by power query

    Quote Originally Posted by Bo_Ry View Post
    Please try

    Please Login or Register  to view this content.
    IMHO leave null data is really bad idea for database.
    this works well. thanks for your solution.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 10
    Last Post: 06-25-2020, 12:19 AM
  2. Power Query Merge Columns if Not Null
    By brent_milne in forum Excel General
    Replies: 1
    Last Post: 01-26-2020, 11:41 AM
  3. Power Query occassionally and unexpectedly duplicates value
    By _MANNY_ in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-18-2019, 07:13 AM
  4. [SOLVED] Power Query showing Null but values exist?
    By taylorsm in forum Excel General
    Replies: 3
    Last Post: 04-10-2018, 10:19 AM
  5. SQL: How do I replace NULL ( empty ) with zero in a sql query. For instance:
    By kbdb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-09-2018, 03:31 PM
  6. Replies: 9
    Last Post: 11-29-2017, 01:32 PM
  7. How to remove null values from several columns with Power Query?
    By toblju in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2016, 11:08 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1