jeudi 21 janvier 2021

Switch (True); The same column contain multiple search criteria in Power BI

  1. If column A contain "TP" then "Yes".
  2. If column A contain "TP-" then "Yes".
  3. If column A contain "-A" then "Yes".
  4. If column A does not contain "TP","TP-","-A" then desired result is "No".

In Excel I am applying the following formula =IF(SUM(COUNTIF(A2,{"TP","TP-","-A*"})),"YES","NO")in order to get the my final result.

Note:

Column A contain text and numbers and Prefix and suffix or prefix with suffix as well.

DATA and DESIRED RESULT;

ITEM DESIRED RESULT 1234567TP YES 1234567TP-0001 YES 1234567TP-0001DR YES 1234567TP-DR0001DR YES 1234567TP-A0006DR YES 1234567TP-A90001DR YES 1234567TP-A0001DR YES 7674859YO-A891 YES 456YO-A12 YES 87654HI-A0000098 YES 1234678VU NO 1234678VU-P00094 NO 1234678VU-P00089 NO 1234678VU-P00567 NO

enter image description here

Aucun commentaire:

Enregistrer un commentaire