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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

I am not Understanding How the LEN and Search function are working.

Dax.PNG

1 ACCEPTED SOLUTION

@Anonymous -

Maybe this explains how 11 is returned? 12 - 1 = 11

 

99.PNG






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



View solution in original post

4 REPLIES 4
ChrisMendoza
Resident Rockstar
Resident Rockstar

@Anonymous -

Operator Precendence / Order of Operations seems to be messing up your calculation.

 

You could enclose with ( ) as:

LEN ( Customer[Customer] ) - ( SEARCH ( "(", Customer[Customer], 1, 0 ) - 1)

or you could write two variables as:

Column = 
VAR lenCust = LEN ( Customer[Customer] )
VAR searchParen = SEARCH ( "(", Customer[Customer], 1, 0 ) - 1

RETURN lenCust - searchParen





Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Anonymous
Not applicable

Hi Chris,

 

Thank you for your reply.  I know how to get the right total since 11 is the correct total.  My issue is I am not understanding how The Value of LEN('Customer'[Customer]) – SEARCH("(",'Customer'[Customer],1,0) – 1 equals 11.

 

If the Length is 27 and the value of the Search is 14, then how is it possible that statement equals 11 instead of 13 when 27 - 14 = 13.  I'm needing someone to explain how the 11 is derived.

 

Kind Regards,

 

Hexagony

@Anonymous -

Maybe this explains how 11 is returned? 12 - 1 = 11

 

99.PNG






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Anonymous
Not applicable

That's fantastic Chris!  I totally understand it now.  Thank you so much!

 

Kind Regards,

 

Hexagony

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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 Solution Authors