Forum Discussion

Nima Mohandesan's avatar
Nima Mohandesan
Copper Contributor
Jul 12, 2019
Solved

Data modeling and table lengths in Excel

Hi,   In an Excel solution, I bring in data from SQL connection to worksheet 1 (WS#1), thus the data set number of rows changes each time. A second worksheet (WS#2)runs calculation on WS#1. My prob...
  • Subodh_Tiwari_sktneer's avatar
    Subodh_Tiwari_sktneer
    Nov 28, 2019

    Nima Mohandesan 

    There is Text.PositionOf function in Power Query which returns the position of the sub-string in a Text Column and if the sub-string is not found, it returns -1.

     

    The syntax would be like this...

     

    =Text.PositionOf(<Text Column>, "<sub-string being searched>")

     

    You may replace the -1 with 0 in the added column if the sub-string was not found like this...

     

    =Replacer.ReplaceValue(Text.PositionOf(<Text Column>, "<sub-string being searched>"),-1,0)

Resources