Monday, January 18, 2021

Power Query - List IN

 

  #"Added custom1" = Table.AddColumn(#"Changed column type", "VP"each 
  if (List.Contains({"ZNLD","ZNLM"},[DOC_TYPE]) and 
    (List.Contains({"5","6","8","9"},Text.Middle(Text.Replace([#".NIF_Venda"], "PT"""), 31)))
    )  then "E" //Empresa
    else if (List.Contains({"ZNLD","ZNLM"},[DOC_TYPE]) and 
         not(List.Contains({"5","6","8","9"},Text.Middle(Text.Replace([#".NIF_Venda"], "PT"""), 31)))
         )  then "P"  //Pessoal
         else if List.Contains({"ZOTP","ZREP","ZG2P","ZGCP"},[DOC_TYPE]) then "F"  //Frota
         else "?")
in
  #"Added custom1"


OR....

  #"Filtered rows 1" = Table.SelectRows(#"Changed column type", each (List.Contains({1100001590,1100001591,1100001639,1100001640,1100001642,1100001643,1100001644,1100001645,1100001646,1100001647,1100001648,1100001649},[#"/BIC/ZMATERIAL"])))
in
  #"Filtered rows 1"

No comments:

Post a Comment

Power BI APP - Delete or Unpublish

 UNPUBLISH DELETE