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

Comparing 2 columns

HI,

 

I am comparing 2 columns and displaying the required text in the new column using the specs below.

 

  • IF Doc Type = Observation THEN “Audit Report without Observation”
  • IF Doc Type = Audit AND TRN ID is in  Parent ID Field THEN “Audit Report with Observation”
  • IF Doc Type =Audit AND  TRN is not in Parent ID Field THEN “Audit Report without Observation”
 
 
 
From the image below i need to check if 148833 is present in PARENT_ID and display "Audits with observation". 
The formula i used is: 
 
Counts = IF('Audit and Obs Data'[DOC_TYPE] = "Observation", "Audit without Observation", IF('Audit and Obs Data'[DOC_TYPE]="Audit" && CONTAINS('Audit and Obs Data','Audit and Obs Data'[TRN_ID],'Audit and Obs Data'[PARENT_ID]), "Audit","Audits without Observation"))
2019-12-04_13-57-08.jpg
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Comparing 2 columns

@kalyan209 you can containsrow function to find if TRN_ID exists in PARENT_ID or not

 

Is Parent Exists = 
CONTAINSROW( VALUES('Table'[Parent_Id] ), 'Table'[TRN_ID] )

 






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

3 REPLIES 3
Highlighted
Super User IV
Super User IV

Re: Comparing 2 columns

@kalyan209 you can containsrow function to find if TRN_ID exists in PARENT_ID or not

 

Is Parent Exists = 
CONTAINSROW( VALUES('Table'[Parent_Id] ), 'Table'[TRN_ID] )

 






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

Highlighted
Super User IV
Super User IV

Re: Comparing 2 columns

@kalyan209 did you tried the formula? Put this new column in your table visual and you will find out if it is working or not.






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Highlighted
Frequent Visitor

Re: Comparing 2 columns

@parry2k it worked 

thanks for the formual 

Helpful resources

Announcements
June 2020 Community Highlights

June 2020 Community Highlights

Featured community members, changes to the Community, and more! Read up on recent Power BI community news.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors