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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
PeteS
New Member

Custom column to compare across 2 tables

I'm struggling to get this working..

I need a custom column in table A. Table A has the following 'chargecode' column:

Table A:

 

PeteS_0-1692199752456.png

 

Table B has a list of potential chargecodes in the 'CC' column:

PeteS_1-1692199798047.png

 

 

The custom column would simply be:
If Table A 'Chargecode' is found in Table C 'CC' then show '1', else show '0'

 

Thank you

1 ACCEPTED SOLUTION
ray_aramburo
Super User
Super User

Hi,

Adapting this post  your solution would be:

NewColumn =
VAR _SEL = SELECTCOLUMNS('TableC', "CC", 'TableC'[CC])
RETURN
IF('TableA'[Chargecode] IN _SEL, 1, 0)




Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @PeteS ,

 

Please new a custom column like:

Number.From(List.Contains(#"Table B"[CC],[Chargecode],Comparer.FromCulture(Culture.Current,true)))

Check  the pbix file.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

ray_aramburo
Super User
Super User

Hi,

Adapting this post  your solution would be:

NewColumn =
VAR _SEL = SELECTCOLUMNS('TableC', "CC", 'TableC'[CC])
RETURN
IF('TableA'[Chargecode] IN _SEL, 1, 0)




Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors