Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello All,
I have a table like this in Excel where column "B" is bringing "TRA" everytime it finds that word within the codes in column "A"... no matter where "TRA" is positioned in the word.
For doing so, i'm using ISNUMBER + SEARCH formulas and works like a charm. Can you guys please help me replicate this in DAX??
This is the formula in cell B2: =IF(ISNUMBER(SEARCH($B$1;A2));"TRA";"")
Thanks!
Edson
Solved! Go to Solution.
Hi @Anonymous ,
You can do it in many ways.
Some listed
Incase of M create a Conditional Column
In DAX you can create a new Column
DAX COLUMN 1 =
IF (
SEARCH (
"TRA",
'Table'[String],
1,
0
) > 0,
"TRA",
BLANK ()
)
DAX Column = IF (CONTAINSSTRING('Table'[String], "TRA"), "TRA" ,BLANK())
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @Anonymous ,
You can do it in many ways.
Some listed
Incase of M create a Conditional Column
In DAX you can create a new Column
DAX COLUMN 1 =
IF (
SEARCH (
"TRA",
'Table'[String],
1,
0
) > 0,
"TRA",
BLANK ()
)
DAX Column = IF (CONTAINSSTRING('Table'[String], "TRA"), "TRA" ,BLANK())
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
@Anonymous , You can create a new column
if(CONTAINSSTRING([codes], "TRA") ,"TRA",blank())
https://docs.microsoft.com/en-us/dax/containsstring-function-dax
Other is
Same thing in DAX . Use FIND() (case sensitive) or SEARCH() (not case sensitive) and handle the result the same way.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |