Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How List.PositionOF works

But this result seems strange only to me?

 

image.png

For the moment I do not exploit what does not fit me.
I would like to see if anyone else has the same impression as me.

 

9 REPLIES 9
CNENFRNL
Community Champion
Community Champion

More myths about this mysterious ""(zero-length string)

Screenshot 2020-09-16 031704.png

Screenshot 2020-09-16 031919.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

this seems to me consistent with the fact that the string "" does not contain any characters and therefore there is no corresponding number: it does not exist in the ascii table
do not you think?

 

@Anonymous Yes, my point is since no ascii code is assigned to "", why Text.PositionOf returns positions of "" in "aba", whereas "aba" doesn't split at those positions?

Nowhere to find an explanation to the mechanism to parse "" by PQ. 🤔


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

Hi @CNENFRNL ,

I came up with this idea, to give a possible explanation to your interesting observation:
"" is obviously not a character but it is a text (empty but text, while the "empty" character does not exist).


If "" could be used as a character it would become a sort of wildcard like the "?".
In fact, if you use the function:
Text.EndsWith ("abc", "c")
gives TRUE
and the same happens with

Text.EndsWith ("abc", "") -> TRUE.

From this we could derive that "c" = "" 🙂 and if it holds for c, it holds for any other character.

Icey
Community Support
Community Support

Hi @Anonymous ,

 

Why can't we think of it this way: “abc” ends with "" when in " Text.EndsWith("abc", "") " and "abc" ends with "c" when in " Text.EndsWith("abc", "c") "?

 

There can be a "" behind "c" in "abc", right?🤔

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

 

 

 

<<If "" could be used as a character it would become a sort of wildcard like the "?".>>

 

What was written was to prove that "" is a string and not a single character, because if it were(*) there would be the contradictory result that "" is equal to any character.

However, apart from these dialectical joke, what I wanted to point out is that the

Text.PositionOf ("abc", ...)
finds only 3 empty substrings and not 4 as I would have expected (also for symmetry),

If you use Text.PositionOf (text.reverse ("abc"), ...) you get the same result)

 

PS

I observed this, in my opinion strange, behavior while trying to find a custom function for the VLOOKUP

 

 

(*)

if "" is considered, as it actually should, as a string instead there is no contradiction as there is not in these cases:

 

Text.EndsWith("abc","c")=true

Text.EndsWith("abc","bc")=true

from which the only logical consequence that can be drawn is that one of the two strings is a substring of the other, but not that they are equal

 

 

 

Jimmy801
Community Champion
Community Champion

Hello

 

it's strange and funny at the same time. And seeing this

Jimmy801_0-1600167004313.png

also kinda wrong?

 

Jimmy

Anonymous
Not applicable

a hint

 

 

Spoiler
image.png
Anonymous
Not applicable

a second hint

 

Spoiler
image.png

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors