Iteration for DAX CONTAIN Function inside an IF statement

nikkollai

New Member
Joined
Sep 10, 2014
Messages
49
Hello,

Another conundrum here i am having trouble to resolve.

I have two columns with data : Product ONE and Product TWO.
Some of the Product ONE data contains the word Modified ; i need to create an IF statement , find those records that contain the word Modified in column Product ONE and bring Product TWO value into a third column (The code i Need). If there is no word "Modified" then keep Product ONE valuein column The code i Need

You can see the end result below.
Any ideas will be highly appreciated.

Tks, N


[TABLE="width: 500"]
<tbody>[TR]
[TD]Product ONE
[/TD]
[TD]Product TWO[/TD]
[TD]The code i Need
[/TD]
[/TR]
[TR]
[TD]PPA Modified
[/TD]
[TD]WOLAP-51-813
[/TD]
[TD]WOLAP-51-813
[/TD]
[/TR]
[TR]
[TD]PPA Modified
[/TD]
[TD]WOOA-65-8496
[/TD]
[TD]WOOA-65-8496
[/TD]
[/TR]
[TR]
[TD]AP05-12053
[/TD]
[TD][/TD]
[TD]AP05-12053
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
You aren't looking for the CONTAINS() function, which is to look for a value anywhere in a column. You are looking for SEARCH() or FIND() though I can never keep them straight.

But it's just going to be a calc column with something like:
=IF( SEARCH("Modified", Table1[ProdOne], 1, 0), [ProdOne], [Prod2])
 
Upvote 0
Thank you scottsen
It works. I actually tried this option but never put in the optional parameters start_num and NotFoundValueand was getting an error.
Any ideas why optional parameters suddenly became mandatory.

YIELDS AN ERROR =IF( SEARCH("Modified", Table1[ProdOne]), [ProdOne], [Prod2])


WORKS =IF( SEARCH("Modified", Table1[ProdOne], 1, 0), [ProdOne], [Prod2])

<tbody>
</tbody>

Thanks again
N -
 
Upvote 0
I honestly have an epic fight w/ those functions each time I use them :) Don't feel alone...
 
Upvote 0

Forum statistics

Threads
1,224,065
Messages
6,176,170
Members
452,710
Latest member
mrmatt36

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top