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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ezequiel
Employee
Employee

FIND and conditional

Hi!

 

I need your help with a DAX formula for a new column. I have some names on a column with the format "firstname.lastname" and some other values with the format "firstname lastname". I need a IF formula saying that if the field contains a "." in the string, then do something and if not do something else.

 

I've been trying but I couldn get a result. Can you please help on this?

 

Thanks!

1 ACCEPTED SOLUTION
Phil_Seamark
Employee
Employee

HI @ezequiel

 

Please try this

 

Column = 
    IF(
        FIND(
            ".",
            'Table1'[Column1],
            1,
            0
            )>0 
        , "Found" 
        , "Not Found"
        )

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

4 REPLIES 4
ChrisMendoza
Resident Rockstar
Resident Rockstar

hello @ezequiel,

 

I see you've found a solution already however, I decided to research an additional solution that I may need some day because it seems like it's only a matter of time before I need it.

 

Expanding on @Phil_Seamark's solution:


Column 2 = 
IF (
    FIND ( ".", Table4[Name], 1, 0 ) > 0,
    PATHITEM ( SUBSTITUTE ( Table4[Name], ".", " " ), 1 ),
    Table4[Name]
)

6.PNG

Thanks @Phil_Seamark for presenting your solution!






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!



Phil_Seamark
Employee
Employee

HI @ezequiel

 

Please try this

 

Column = 
    IF(
        FIND(
            ".",
            'Table1'[Column1],
            1,
            0
            )>0 
        , "Found" 
        , "Not Found"
        )

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi Phil

 

thanks for the reply. I'm getting this error applying the formula

 

The syntax for '0' is incorrect.

 

Can you help me on this?

 

Thanks!

 

Ezequiel

HI @ezequiel

 

Are you trying to create a calculated column or measure?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.