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
Hikmet_JCI
Frequent Visitor

need help with >> IF ( seach or left

Hi

need a column where we searched in one column and in another column starts from the left but related to order number

example :
if the item text is "tee" or item starts with "10" then at order number level yes otherwise blank


??

Hikmet_JCI_0-1644345458039.png

thank you thank you

2 ACCEPTED SOLUTIONS

I see.

How about this:

tomfox_0-1644348625916.png

 

TomsMeasure1 = 
IF ( 
    CALCULATE ( 
        MAX ('Table'[TomsNewColumn1] ), 
        ALLEXCEPT ( 'Table','Table'[OrderNr] ) ) = "yes", 
        CALCULATE ( 
        MAX ('Table'[TomsNewColumn1] ), 
        ALLEXCEPT ( 'Table','Table'[OrderNr] ) ),
        "" 
)

 

I used a measure now referring to TomsNewColumn1

 

Was it this you were looking for?

/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom

 

 

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

Hi @Hikmet_JCI ,

 

It is not very clear to me what your additional constraint logic is, but I'll give it a shot:

IF(
    LEFT ( 'Table'[Item], 2 ) = "10" &&
    CONTAINSSTRING( 'Table'[Item Text], "black" ) &&
    ( CONTAINSSTRING( 'Table'[Item Text], "x1" ) || ( 'Table'[Item Text], "x2" ) ),
     "yes",
     BLANK()
)

 

/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

7 REPLIES 7
Hikmet_JCI
Frequent Visitor

i need help here!!!

I would have to expand this
TomsNewColumn1 =
IF (
LEFT ( 'Table'[Item], 2 ) = "10" || CONTAINSSTRING( 'Table'[Item Text], "tee" ),
"yes",
BLANK()
)


what i want to do :
two fixed parameters IF ( LEFT ="10" ) and item text "Black" occurs
two additional variable parameters CONTAINSSTRING (Item Text "x1") or (Item Text "x2")

 

that's not how it works :
IF ( LEFT ( 'Table'[Item], 2 ) = "10" &&
CONTAINSSTRING( 'Table'[Item Text], "black" ) &&
CONTAINSSTRING( 'Table'[Item Text], "black" ) or ( 'Table'[Item Text], "black" )
"yes",
BLANK()
)

Hi @Hikmet_JCI ,

 

It is not very clear to me what your additional constraint logic is, but I'll give it a shot:

IF(
    LEFT ( 'Table'[Item], 2 ) = "10" &&
    CONTAINSSTRING( 'Table'[Item Text], "black" ) &&
    ( CONTAINSSTRING( 'Table'[Item Text], "x1" ) || ( 'Table'[Item Text], "x2" ) ),
     "yes",
     BLANK()
)

 

/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

thanks

tackytechtom
Super User
Super User

Hi @Hikmet_JCI ,

 

If either of the two tables fulfill your requirement, then see DAX code below:

tomfox_0-1644346948327.png

 

TomsNewColumn1 = 
IF ( 
    LEFT ( 'Table'[Item], 2 ) = "10" || CONTAINSSTRING(  'Table'[Item Text], "tee" ), 
    "yes", 
    BLANK() 
)

 

TomsNewColumn2 = 
IF ( 
    LEFT ( 'Table'[Item], 2 ) = "10" || LEFT (  'Table'[Item Text], 3 ) = "tee", 
    "yes", 
    BLANK() 
)

 

The first code snippet returns "yes" if Item starts with 10 or Item text contains "tee", while the second returns "yes" if item starts with 10 or item text starts with "tee".

 

Hope this helps! 🙂

 

/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom

 

 

 





Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

thank you
now the splate should be added because the same order number

Hikmet_JCI_0-1644348042153.png

 

I see.

How about this:

tomfox_0-1644348625916.png

 

TomsMeasure1 = 
IF ( 
    CALCULATE ( 
        MAX ('Table'[TomsNewColumn1] ), 
        ALLEXCEPT ( 'Table','Table'[OrderNr] ) ) = "yes", 
        CALCULATE ( 
        MAX ('Table'[TomsNewColumn1] ), 
        ALLEXCEPT ( 'Table','Table'[OrderNr] ) ),
        "" 
)

 

I used a measure now referring to TomsNewColumn1

 

Was it this you were looking for?

/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom

 

 

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

great thank you !!!!

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.