Forum Discussion

Mohamed_Noor's avatar
Mohamed_Noor
Frequent Visitor
3 years ago
Solved

Required to keep Min and Max values - Power Query

Dear All,

 

I would keep only the rank column as min and max value of details from the below table using power query

EXample

Name    RANK

ARP1
ARP2
ARP3
ARP4
ARP5
DAS1
DAS2
DAS3
SAD1

Looking for

NameRANK
ARP1
ARP5
DAS1
DAS3
SAD1
  • Anonymous's avatar
    Anonymous
    3 years ago

    Nice. 

    --Nate

2 Replies

  • let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText(
            "i45WcgwKUNJRMlSK1YGxjZDYxkhsEyS2KZjt4hgM1wthGyGxIXqDHV0gamIB", BinaryEncoding.Base64), Compression.Deflate)), 
            type table [Name = (type nullable text), Rank = (type number)]),
        tbl = Table.Group(Source, {"Name"}, {{"Rank", each List.Distinct({List.Min([Rank]),List.Max([Rank])})}}),
        tbl1 =Table.ExpandListColumn(tbl, "Rank"),
        Result = Table.TransformColumnTypes(tbl1,{{"Rank", Int64.Type}})
    in
        Result
    • Anonymous's avatar
      Anonymous
      Not applicable

      Nice. 

      --Nate