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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Problem in Comparing Two Columns

Hi all,

 

I'm facing a problem with comparing to columns.

 

so what basically happens when I create a conditional column is that it compares a row with it corresponding row in the other column.

however, I need to compare a single values from the first column with all values fro the second column until it finds a match, else "New"

Noor_Rahmeh_0-1615960986079.png

I will add an example just to clarify it more.

if "web Developer" ( in 'Actual Jobs') = 'Career Path Jobs' 

then 'Career Path Jobs' 

Other "New" 

 

But as I said, it only compares a singles row while I want it to iterate on all 'Career Path' Column until it finds a match.

 

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@Anonymous 

Create the following column: 

Column = IF([Actual Jobs] in VALUES('Table'[Career Path Jobs]),[Actual Jobs],"New")
 
The downside is if the job name is not exactly same in both columns, they cannot be detected. For example, there are 2 spaces in the "Account  Manger" in Column 2, but only 1 space in Column 1. As the result, it returns "New" because they are not matching. You might want to update the list to prevent such differences.

column 1 and 2.JPG

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
V-pazhen-msft
Community Support
Community Support

@Anonymous 

Create the following column: 

Column = IF([Actual Jobs] in VALUES('Table'[Career Path Jobs]),[Actual Jobs],"New")
 
The downside is if the job name is not exactly same in both columns, they cannot be detected. For example, there are 2 spaces in the "Account  Manger" in Column 2, but only 1 space in Column 1. As the result, it returns "New" because they are not matching. You might want to update the list to prevent such differences.

column 1 and 2.JPG

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Anonymous , Try a new column like

 

if(not(isblank(LOOKUPVALUE([Actual Jobs], [Career Path Jobs],[Actual Jobs]))),"New" ."Career Path Jobs")

 

or

 


new column =
var _1 =[Actual Jobs]
return
if( countx(filter(search(_1,[Career Path Jobs],,0)>0),[Career Path Jobs])+0=0,"New" ."Career Path Jobs")

Anonymous
Not applicable

@amitchandak  

I tried applying those two solutions but they are comparing Career Pth jobs colomns with itself.

Noor_Rahmeh_0-1615963367957.png

 

@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Anonymous
Not applicable

@amitchandak 

Yes, sure!

https://drive.google.com/file/d/1wUp8rbTvrO1qLaVb0BE-bZhRyIC7sq5f/view?usp=sharing

 here is a link to the excel sheet 

mainly the concept is when there is a match between the first and the second coloumn then write the 'Career path job'

else write "New"

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.