Khalil Liraqui
Khalil Liraqui

Reputation: 415

"starts with" in an expression using DAX

how can write an expression with DAX to check if a String starts by an other string ? example : ext.example starts with "ext."

Upvotes: 5

Views: 33106

Answers (2)

Miguel
Miguel

Reputation: 1

you can use text functions

=FIND("BMX","line of BMX racing goods")

check

https://msdn.microsoft.com/en-us/library/ee634938.aspx

https://msdn.microsoft.com/en-us/library/ee634882(v=sql.120).aspx

Upvotes: -2

alejandro zuleta
alejandro zuleta

Reputation: 14108

This expression does the work,

NewColumn =
IF (
    LEFT ( TableName[ColumnToSearchIn], LEN ( "Some string" ) ) = "Some string",
    "Starts With",
    "Does not start with"
)

This expression will determine if ColumnToSearchIn starts with Some string.

Let me know if this helps.

Upvotes: 10

Related Questions