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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Twizxup
Frequent Visitor

Check if value in column A exists in column B for a specific id

Hi All,

 

This is probably way easier than I think but I'm struggling to create a calculation that, for a given ID, checks if the value in column A also exists in column B.

 

For example:

 

Employee ID 123 returns TRUE because the Actual Code exists in the Forecasted Code column for that same ID

Employee ID 345 returns FALSE because the Actual Code does not exist in the Forecasted Code column for that same ID

Employee ID 567 returns FALSE because the Actual Code does not exist in the Forecasted Code column for that same ID

Employee ID 789 returns TRUE because the Actual Code exists in the Forecasted Code column for that same ID

 

Employee IDActual CodeForecasted CodeFLAG
123LOANMANLOANMANTRUE
345CLDARCHMFDPAQTFALSE
567CLDARCHCLDMFAMFALSE
567CLDARCHMFDPAMTFALSE
567CLDARCHMFDPAQTFALSE
567CLDARCHMFDPLRMFALSE
567CLDARCHMFDPMFPFALSE
789DEVEXPRCLDCORPTRUE
789DEVEXPRCLDFINTTRUE
789DEVEXPRDEVEXPRTRUE
789DEVEXPRP2PCONTTRUE

 

Any help would be greatly appreciated! Thank you in advance.

1 ACCEPTED SOLUTION

thats also ok, you can do that first, and return 0 or 1, and then group by the employee, max(flag), and if it has a  value, then max will surface it on the group by





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
vanessafvg
Super User
Super User

vanessafvg_0-1712091643563.png

see example attached

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




vanessafvg
Super User
Super User

where are you creating this if statment and how

 

using power query 

just create a conditional column if  a = b then 1 else 0





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




I can't figure out how to create it in PowerQuery (althugh that'd be ideal for my purpose) so I'm assuming it'd have to be a measure.

 

Unfortunately that doesn't work because I don't need the values to equal each other at the row-level, but rather for the value in "Actual Code" column to be present anywhere (for the specified Employee ID) in the "Forecasted Code" column. Employee ID 789 is a good example.

 

I don't think this is possible in Power Query

thats also ok, you can do that first, and return 0 or 1, and then group by the employee, max(flag), and if it has a  value, then max will surface it on the group by





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




This works great, thank you! The only thing I changed about your suggestion is that I concatenated the Employee ID and the Actual Code, and then I grouped by that instead.

 

It appears to work exactly as I had hoped -- thank you!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.