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! Request now

Reply
CBartkowiak
Regular Visitor

Creating entries in Table A from Table B

Dear experts,

I´m a newby on Power BI /Power Query and I hope, you can help me to solve my problem. Thx in advance.

I have two tables (Table A and Table B) and I´d like to use B to create entries in A. At the end I´d like to have one row for each category for each customer. If the row got created, the the value should be "0". I hope, I was able to explain my issue. Below the tables as example

 

Table 1  
   
customercategoryvalue
aaa12
add5
bee21
cbb29
cff21

 

Tabel 2
 
category
aa
bb
cc

 

Final  
   
customercategoryvalue
aaa12
abb5
acc0
bcc21
baa0
bbb0
cbb29
ccc21
caa0

 

Thank you

2 ACCEPTED SOLUTIONS
AMeyersen
Resolver III
Resolver III

I'd do it in several steps:

  1. create a subquery containing all distinct customer values
  2. do a cross join with the category table (get each combination of customer/category exactly once)
    https://learn.microsoft.com/en-us/power-query/cross-join
  3. do a full outer join on your example "Table1" with the result query of step 2. Use columns Customer and Category as join criteria
  4. add custom columns which contain the correct results from each part of the join
  5. delete unnecessary indermediate columns

 

View solution in original post

CBartkowiak
Regular Visitor

HI,

thx for your help and sorry for my late reply. It worked for me.

View solution in original post

6 REPLIES 6
CBartkowiak
Regular Visitor

HI,

thx for your help and sorry for my late reply. It worked for me.

ryan_mayu
Super User
Super User

why in the final table b, bb is 21 and c, cc is 21? could you pls explain how to get the output?





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

Proud to be a Super User!




Hi,

I´m sorry for this confusion. This is just an issue on copy & paste on creating the test table

Does @AMeyersen 's solution work for you? if not ,pls correct the expected output.





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

Proud to be a Super User!




HI,

thx for asking. I didn´t find the time yet to test it, but I´ll leave a comment, when tested.

AMeyersen
Resolver III
Resolver III

I'd do it in several steps:

  1. create a subquery containing all distinct customer values
  2. do a cross join with the category table (get each combination of customer/category exactly once)
    https://learn.microsoft.com/en-us/power-query/cross-join
  3. do a full outer join on your example "Table1" with the result query of step 2. Use columns Customer and Category as join criteria
  4. add custom columns which contain the correct results from each part of the join
  5. delete unnecessary indermediate columns

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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