How to convert URL-contains Excel formula to Power BI calculated column?











up vote
0
down vote

favorite












I use this Excel formula to tell if the URL in the A column contains the '/amp/' string:



 = IF(OR(SUMPRODUCT(--((ISERR(SEARCH({"/amp/"},a2)))))>0),FALSE,TRUE)))))))))))))


How would I do that in a calculated column/measure in Power BI?










share|improve this question


























    up vote
    0
    down vote

    favorite












    I use this Excel formula to tell if the URL in the A column contains the '/amp/' string:



     = IF(OR(SUMPRODUCT(--((ISERR(SEARCH({"/amp/"},a2)))))>0),FALSE,TRUE)))))))))))))


    How would I do that in a calculated column/measure in Power BI?










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I use this Excel formula to tell if the URL in the A column contains the '/amp/' string:



       = IF(OR(SUMPRODUCT(--((ISERR(SEARCH({"/amp/"},a2)))))>0),FALSE,TRUE)))))))))))))


      How would I do that in a calculated column/measure in Power BI?










      share|improve this question













      I use this Excel formula to tell if the URL in the A column contains the '/amp/' string:



       = IF(OR(SUMPRODUCT(--((ISERR(SEARCH({"/amp/"},a2)))))>0),FALSE,TRUE)))))))))))))


      How would I do that in a calculated column/measure in Power BI?







      excel excel-formula powerbi powerbi-desktop






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 17 at 15:06









      simpatico

      4,5031564110




      4,5031564110
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          You can use FIND function to search for the /amp/ in the column where the URL is stored. You can define the value to be returned, if the pattern is not found, but not the value in case it is. So you can use IF to be able to freely define "contains" and "do not contains" values.



          =IF(FIND("/amp/", 'TableName'[ColumnWithURL], -1) = -1, <value_if_true>, <value_if_false>)





          share|improve this answer





















          • IsAMP = IF(FIND("/amp/", ABC[Landing Page], 1, -1) = -1, false, true)
            – simpatico
            Nov 17 at 16:46











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53352460%2fhow-to-convert-url-contains-excel-formula-to-power-bi-calculated-column%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote



          accepted










          You can use FIND function to search for the /amp/ in the column where the URL is stored. You can define the value to be returned, if the pattern is not found, but not the value in case it is. So you can use IF to be able to freely define "contains" and "do not contains" values.



          =IF(FIND("/amp/", 'TableName'[ColumnWithURL], -1) = -1, <value_if_true>, <value_if_false>)





          share|improve this answer





















          • IsAMP = IF(FIND("/amp/", ABC[Landing Page], 1, -1) = -1, false, true)
            – simpatico
            Nov 17 at 16:46















          up vote
          0
          down vote



          accepted










          You can use FIND function to search for the /amp/ in the column where the URL is stored. You can define the value to be returned, if the pattern is not found, but not the value in case it is. So you can use IF to be able to freely define "contains" and "do not contains" values.



          =IF(FIND("/amp/", 'TableName'[ColumnWithURL], -1) = -1, <value_if_true>, <value_if_false>)





          share|improve this answer





















          • IsAMP = IF(FIND("/amp/", ABC[Landing Page], 1, -1) = -1, false, true)
            – simpatico
            Nov 17 at 16:46













          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          You can use FIND function to search for the /amp/ in the column where the URL is stored. You can define the value to be returned, if the pattern is not found, but not the value in case it is. So you can use IF to be able to freely define "contains" and "do not contains" values.



          =IF(FIND("/amp/", 'TableName'[ColumnWithURL], -1) = -1, <value_if_true>, <value_if_false>)





          share|improve this answer












          You can use FIND function to search for the /amp/ in the column where the URL is stored. You can define the value to be returned, if the pattern is not found, but not the value in case it is. So you can use IF to be able to freely define "contains" and "do not contains" values.



          =IF(FIND("/amp/", 'TableName'[ColumnWithURL], -1) = -1, <value_if_true>, <value_if_false>)






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 17 at 15:49









          Andrey Nikolov

          1,461139




          1,461139












          • IsAMP = IF(FIND("/amp/", ABC[Landing Page], 1, -1) = -1, false, true)
            – simpatico
            Nov 17 at 16:46


















          • IsAMP = IF(FIND("/amp/", ABC[Landing Page], 1, -1) = -1, false, true)
            – simpatico
            Nov 17 at 16:46
















          IsAMP = IF(FIND("/amp/", ABC[Landing Page], 1, -1) = -1, false, true)
          – simpatico
          Nov 17 at 16:46




          IsAMP = IF(FIND("/amp/", ABC[Landing Page], 1, -1) = -1, false, true)
          – simpatico
          Nov 17 at 16:46


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53352460%2fhow-to-convert-url-contains-excel-formula-to-power-bi-calculated-column%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

          Alcedinidae

          Origin of the phrase “under your belt”?