Results 1 to 3 of 3

Thread: Check Multiple Columns For Condition And Duplicate Rows

  1. #1
    Neophyte sajidali_sa's Avatar
    Join Date
    Aug 2020
    Location
    Khi
    Posts
    2
    Articles
    0
    Excel Version
    365

    Exclamation Check Multiple Columns For Condition And Duplicate Rows



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi All,
    I am very new to Power BI and need help in following...
    I am running a query based on answer in this thread to copy rows based on a condition...

    HTML Code:
    let
        CN = [#"Column4"]
    in
         if Text.Length(CN)=11 and Value.Is(Text.Start(CN,4),type text) and Value.Is(Number.FromText(Text.End(CN,7)),type number)
        then List.Repeat({CN},13)
        else {CN}

    But its checking this condition in only one column i.e. Column4 while I want it to check condition on Column3, Column4 and Column5. Any help please?
    ~S@~

  2. #2
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,418
    Articles
    44
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    Can you supply a short sample data set with a before and after of what you're trying to accomplish? There are a couple of different directions this could go, depending on your desired output.
    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

  3. #3
    Neophyte sajidali_sa's Avatar
    Join Date
    Aug 2020
    Location
    Khi
    Posts
    2
    Articles
    0
    Excel Version
    365
    Yes sure.
    Actually data looks like this

    Click image for larger version. 

Name:	2020-08-21_22-25-15.jpg 
Views:	16 
Size:	103.6 KB 
ID:	9964

    This data is extracted from a lot of PDFs so its messy. And columns of my interest are G, H, and I. If length of any of cell in these columns is 11 AND its first four of content of same cell are TEXT and Last 7 are numbers then I need to copy the entire row (from column A to Z) 13 times.

    Another thing that is in my mind is if we remove all blanks from column A to Z then all of these Columns will come to Column F and then we can use the query that I mentioned earlier in my post to copy rows 13 times if conditions are met.

    Which ever is easy for you to understand
    ~S@~

Tags for this Thread

Posting Permissions

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