Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
The Power Query function Text.PositionOf returns a list when the 'occurrence' parameter is set, so that the common scenario below gives error 'We cannot apply operator + to types List and Number'
Text.PositionOf("String with multiple spaces", " ", 2) + 1
Documentation states that 'An optional parameter occurrence may be used to specify which occurrence position to return (first occurrence by default).' - and that's all it states. It appears this happens because despite declaring the type of the parameter as nullable number, it is expecting an Occurrence.Type enum, so numbers higher than 1 do not correspond to the position within the list that's expected.
The documentation is misleading, so either that needs to be changed, or the parameter behaviour updated to a more reasonable interpretation, or at least restricting to the enum.
FYI I think the best workaround to this is just use Occurrence.All and retrieve the item you want by index
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.