+ Reply to Thread
Results 1 to 2 of 2

Power query: result depends on whether there are duplicate rows in two columns

  1. #1
    Registered User
    Join Date
    04-15-2021
    Location
    Dublin
    MS-Off Ver
    2010
    Posts
    1

    Power query: result depends on whether there are duplicate rows in two columns

    Hi all,

    Could I please have your help with the below matter?
    I am looking for a formula that I can use in Power Query Editor. Basically I'm looking for an IF AND statement for power query. I want it to check for duplicate rows in two columns and give me different outputs depending on the findings.
    Basically the logic would be:
    - If A2=A1 and B2<>B1, then the result should be "Repeat". Otherwise, it should be "New".
    Hopefully it makes sense, please let me know should there be any other info I can provide.

    Thank you,
    Ella

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #1 requires good titles. "Power query" does not give insight to the question. I have updated it for you this time because you are a new member. --6StringJazzer
    Attached Files Attached Files
    Last edited by 6StringJazzer; 04-15-2021 at 05:22 PM.

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,597

    Re: Power query: result depends on whether there are duplicate rows in two columns

    Hello Ella2021 and Welcome to Excel Forum.
    I feel that the logic is more complicated.
    It would seem that the logic is that if a voucher number is listed for the previous day then "Repeat" but if the voucher number isn't listed for the previous day then "New".
    If that is the case then you might try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    That said doing this in Power Query seems overly complicated, as indicated by the following linked article: https://exceloffthegrid.com/power-qu...itional-logic/
    I would suggest using the formula above rather than attempting either the "Power Query If logic using a conditional column" or "IF logic by writing the M code" methodd from the article.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. [SOLVED] Power Query/Power Pivot Conditional Column creation & chart
    By mz_h in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-12-2020, 06:07 PM
  2. [SOLVED] 2 fields checker- Request for alternative option in Power Query or Power Pivot
    By Shareez Saleem in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-15-2020, 08:36 AM
  3. Replies: 10
    Last Post: 06-25-2020, 12:19 AM
  4. [SOLVED] Power Query - excel formula translation into Power Query
    By afgi in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 02-19-2020, 03:38 AM
  5. Replies: 4
    Last Post: 02-17-2020, 06:03 AM
  6. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  7. Replies: 0
    Last Post: 04-05-2018, 01:16 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