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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

I would like to add a column to a table by comparing another table

Hi everyone, 

I am trying to add a custom column by comparing a different table. To simplify let's say I have 2 tables (or 2 queries or 2 datasets). One is called June and another is called July. Both tables are almost identical. both have 2 columns; Client name and sales amount. Sometimes Order placed are canceled, let's say a client placed an order in June and canceled it in July. Now I want to create a column in June called canceledINjuly. I want to compare rows between both tables and put VALUE 1 next in the canceledINjuly column.

 

I am new to POWERBI. Is there a custom column code I can use in power query?

1 ACCEPTED SOLUTION

5 REPLIES 5
mussaenda
Super User
Super User

Hi @Anonymous ,

 

this is doable. please provide a sample data and your desired output to help you better

Anonymous
Not applicable

Thank you @mussaenda for replying. Here I am providing 2 tables, with just 10 entries. IRL I have 1000s of entries for each month. 
This is June Table:

LordSnow_0-1695368998227.png

 

 

This is July Table: 

LordSnow_1-1695369054151.png

 

Now, as you can see in the July table the 1st and the 5th entries are not the same, that is because John Smith and David Lee canceled their orders during the month of July. So I want the PowerBI to automatically add value 1 in the June table column 'canceled in July':

LordSnow_0-1695371266393.png

 

 

Thank you for your help.

 

mussaenda_0-1695392673441.png

 

Anonymous
Not applicable

Thank You This Works!! I am very grateful for this solution

 

so you are saying that every month is one table?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.