cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Text.PositionOf() returning only '-1' in all cirumstances despite search term being present.

Self explanatory I think. 

 

 Col

"test"  

 

Text.PositionOf("test", [Col]) -- returns -1

Error occurs with individual letters and spaces and all values in the column and in different tables. I'm honestly baffled.

 

Hopefully a simple oversight, any help would be amazing!

 

Thanks

1 ACCEPTED SOLUTION
Super User III
Super User III

Hi @tgardner 

The arguments are the wrong way around.  It should be 

 

 

Text.PositionOf([Col], "test"))

 

 

If you have it like this

 

 

Text.PositionOf("test" , [Col]))

 

 

and there is anything before the word test in the Col column, it'll return -1

Phil


If I answered your question please mark my post as the solution.

If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

3 REPLIES 3
Super User III
Super User III

Hi @tgardner 

The arguments are the wrong way around.  It should be 

 

 

Text.PositionOf([Col], "test"))

 

 

If you have it like this

 

 

Text.PositionOf("test" , [Col]))

 

 

and there is anything before the word test in the Col column, it'll return -1

Phil


If I answered your question please mark my post as the solution.

If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

What an embarassing oversight!

 

Thanks so much.

Super User II
Super User II

Hi @tgardner 

with your sample and description I get the following solution:

 

23-10-_2020_21-38-58.png

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session Drive Data Culture with Power BI: Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors