cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
craig811 Regular Visitor
Regular Visitor

Matching data

Hi,

 

I am not sure if it is possbile in Power BI, however is there a way I can match the following:

 

Colunm A has : W345678-New 

Colunm B has : 45635 | W345678

 

As the value 'W345678' exists in both colunms, I want to remove the rows from my report.  All the vlaues I want to match are in the same format as above Colunm A values have -New after each value and Colunm B has a value then |.

 

Many thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-cherch-msft Super Contributor
Super Contributor

Re: Matching data

Hi @craig811 

 

You may try below measure:

Column = IF(ISERROR(FIND(LEFT([ColumnA],FIND("-",[ColumnA])-1),[ColumnB])),0,1)

1.png

Regards,

Cherie

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

View solution in original post

9 REPLIES 9
Super User
Super User

Re: Matching data

Column = IF(FIND(LEFT([ColumnA],FIND("-",[ColumnA])-1),[ColumnB]),1,0)

I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

craig811 Regular Visitor
Regular Visitor

Re: Matching data

Thank you,

 

However I get the following error:'The search Text provided to function 'FIND' could not be found in the given text' any idea how to fix it?

gooranga1 Senior Member
Senior Member

Re: Matching data

Make sure that the first 2 column references are the same. Also does all your data in column A have a "-" before the "new"?

 

Try putting a default value in if you don't find the hyphen.

 

Column = IF(FIND(LEFT([ColumnA],FIND("-",[ColumnA],1,"999999")-1),[ColumnB]),1,0)

 

 

craig811 Regular Visitor
Regular Visitor

Re: Matching data

Thank you for the reply,

 

Yes, I do have some data in ColumnA that does not have - and some rows are blank.

v-cherch-msft Super Contributor
Super Contributor

Re: Matching data

Hi @craig811

 

Could you show some data with screenshot?

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
craig811 Regular Visitor
Regular Visitor

Re: Matching data

Test data screenshot.png

 

Thank you,

 

Please see screenshot attached.

v-cherch-msft Super Contributor
Super Contributor

Re: Matching data

Hi @craig811 

 

You may try below measure:

Column = IF(ISERROR(FIND(LEFT([ColumnA],FIND("-",[ColumnA])-1),[ColumnB])),0,1)

1.png

Regards,

Cherie

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

View solution in original post

craig811 Regular Visitor
Regular Visitor

Re: Matching data

Great thanks Cherie,

 

This might be a silly question, however how do I get the formula to look for the value in columnA and if it exists in column B then enter value 1?

 

For example:

ColumnA              ColumnB

W111234-NEW     TEST

                              71554 |  W111234-NEW   

 

So from the above the value in column A exists in column B ,but might be on a different row in column B. I would still like it to show a value of 1 in the new column. 

 

Hope that makes sense. 

craig811 Regular Visitor
Regular Visitor

Re: Matching data

Thank you for solution,

 

However, how do I get the if statament to look in all the rows of columnB ([Line Description) to find a matching value with colunmA:

Column = IF(ISERROR(FIND(LEFT([Transaction Number],FIND("-",[Transaction Number])-1),[Line Description])),0,1)
 
Currently the above just looks at the one row in columnA to the same row in columnB.

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 473 members 5,278 guests
Please welcome our newest community members: