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
Anonymous
Not applicable

NESTED IF CONTAIN A WORD

Dear Team

 

Im Having this table

contain.png

based on CONDITION, by word filled on CONDITION column. will change RESULT as shown above

how to make it with DAX ??

kinda like

if(search and so on .. 

Thanks

regards

Syaiful

 

1 ACCEPTED SOLUTION
mussaenda
Super User
Super User

@Anonymous,

 

If you are looking for nested ifs,

You may take a look at this.

 

2020_01_20_15_20_38_Untitled_Power_BI_Desktop.png

 

Also, Provide a better sample data. And a clearer explanation.

From what I see from the answers, they all achieved your desired output.

View solution in original post

10 REPLIES 10
mussaenda
Super User
Super User

@Anonymous,

 

If you are looking for nested ifs,

You may take a look at this.

 

2020_01_20_15_20_38_Untitled_Power_BI_Desktop.png

 

Also, Provide a better sample data. And a clearer explanation.

From what I see from the answers, they all achieved your desired output.

Anonymous
Not applicable

THANKS bro

solved

rainer1
Resolver III
Resolver III

Hi,

 

you can use "substitute" like this if your name convention is as you described.

Result = SUBSTITUTE('Table'[Condition];" board";"")

 

the expected Result is then this as you wish.

Substitute.PNG

The SUBSTITUTE function is case-sensitive further reading

https://docs.microsoft.com/en-us/dax/substitute-function-dax

 

If I can help you please Mark my answer as the solution.

Anonymous
Not applicable

thanks for replying

but not what im looking for .

my real data really different.

i just want to make nested if from contain of a word condition

Ok,

 

than you cant try the contains function in an if condition

 

https://docs.microsoft.com/en-us/dax/contains-function-dax

 

for further advise i would be helpful to see a snippet of the real data.

 

 

amitchandak
Super User
Super User

if(search("White Borad",table[col])>0,"White",search("Black Borad",table[col])>0,"Black","Others"))

 

Refer SWITCH

https://community.powerbi.com/t5/Desktop/Help-with-SWITCH-TRUE-with-multiple-items-to-evaluate/td-p/...

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

 

Anonymous
Not applicable

FAILED bro

Hi @Anonymous ,

I want to ask if the values of column “CONDITION” always end with " boarding " characters ? Or it will display in other forms ? If it always ends with " boarding " , you can create a calculated column with SUBSTITUTE function to get the result value as @rainer1 provided.

substitude.JPG

RESULT = SUBSTITUTE('TEST4'[CONDITION]," board","")
 

If it will display in another forms , you may need to provide more sample data, later check if there is any method to achieve it.

 

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Different bro

let say ,,

white board bird

black board cat

red board eagle

 

that why i said , SUBSTITUE cant solve my problem

 

any idea ??

 

im stuck on this

 

thanks

syaiful

Adamtall
Resolver III
Resolver III

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.