Forum Discussion

awolf88's avatar
awolf88
Icon for Helper II rankHelper II
4 years ago
Solved

Filter rows based on unique preferance values

Hi guys,  Currently struggling with a little problem here and was hoping to get from input from you geniusses on how to solve my problem the easiest way:   The data I receive from our ERP is prett...
  • ValtteriN's avatar
    4 years ago

    Hi,

    Here is one way to do this:

    1. Add conditional column: = Table.AddColumn(Source, "S_test", each if List.Contains({"Alex","Martin"},[Sales person]) then 1 else 0)

    This will give 1 to rows with either Alex or Martin

     

     

    2. Sort by this column in descending order
    3. use table.distinct on all but Sales person and the new conditional column:
    = Table.Distinct(#"Changed Type", {"Order","Customer", "Sales date", "QTY"})

    End result:

    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

    My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/