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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
YouCanCallMeAl
Frequent Visitor

Add data from column (of other table) depending on content of both tables

I want to add the content of another table depending on unique reference.

I have 2 Tables (Table1 and Table2).

I want to add a new custom column [newColumn] to Table1 with the [Date] from Table2, depending on [Quarter] and [Version] of both tables.

When [Quarter] and [Version] are identical in both tables, then the value from [Date] has to be copied into [newColumn].

 

Can you help?

 

Table1

QuarterVersion
Q1-Year01unique-reference-101
Q2-Year01unique-reference-101
Q3-Year01unique-reference-101
Q4-Year01unique-reference-101
Q1-Year02unique-reference-101
Q2-Year02unique-reference-101
Q3-Year02unique-reference-101
Q4-Year02unique-reference-101
Q1-Year01unique-reference-102
Q2-Year01unique-reference-102
Q3-Year01unique-reference-102
Q4-Year01unique-reference-102
Q1-Year02unique-reference-102
Q2-Year02unique-reference-102
Q3-Year02unique-reference-102
Q4-Year02unique-reference-102

 

and Table2

QuarterVersionDate
Q1-Year01unique-reference-10101.01.2024
Q2-Year01unique-reference-10102.04.2024
Q3-Year01unique-reference-10103.07.2024
Q4-Year01unique-reference-10103.10.2024
Q1-Year02unique-reference-10103.01.2025
Q2-Year02unique-reference-10105.04.2025
Q3-Year02unique-reference-10106.07.2025
Q4-Year02unique-reference-10106.10.2025
Q1-Year01unique-reference-10201.01.2028
Q2-Year01unique-reference-10202.04.2028
Q3-Year01unique-reference-10203.07.2028
Q4-Year01unique-reference-10203.10.2028
Q1-Year02unique-reference-10203.01.2029
Q2-Year02unique-reference-10205.04.2029
Q3-Year02unique-reference-10206.07.2029
Q4-Year02unique-reference-10206.10.2029
1 ACCEPTED SOLUTION
v-kpoloju-msft
Community Support
Community Support

Hi @YouCanCallMeAl,

Thank you for reaching out to the Microsoft fabric community forum. Thank you @SundarRaj, and @mussaenda, for your inputs on this issue.


After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.

 

vkpolojumsft_0-1743764042899.png


I am also including .pbix file for your better understanding, please have a look into it:

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

Thank you for using Microsoft Community Forum.

View solution in original post

4 REPLIES 4
v-kpoloju-msft
Community Support
Community Support

Hi @YouCanCallMeAl,

Thank you for reaching out to the Microsoft fabric community forum. Thank you @SundarRaj, and @mussaenda, for your inputs on this issue.


After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.

 

vkpolojumsft_0-1743764042899.png


I am also including .pbix file for your better understanding, please have a look into it:

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

Thank you for using Microsoft Community Forum.

Hi @YouCanCallMeAl,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

SundarRaj
Solution Supplier
Solution Supplier

Hi @YouCanCallMeAl 
Here's a solution you could look at. I'll leave the image of the output and M code used below. Thanks!

SundarRaj_0-1743757963510.png

SundarRaj_1-1743757983989.png

Here's the code used:
let
Source = Excel.CurrentWorkbook(){[Name = "Table2"]}[Content],
Table = Table.TransformColumnTypes(Source,{{"Quarter", type text}, {"Version", type text}}),
RefTable = Excel.CurrentWorkbook(){[Name = "Table3"]}[Content],
RefCol = Table.AddColumn(RefTable, "RefCol", each [Quarter] & "-" & [Version]),
AddRefCol = Table.AddColumn(Table, "RefCol", each [Quarter] & "-" & [Version]),
AddDates = Table.TransformColumns(AddRefCol,{"RefCol", each Record.ToList(Record.SelectFields(RefCol{List.PositionOf(RefCol[RefCol],_)},"Date")){0}})
in
AddDates

 

Sundar Rajagopalan
mussaenda
Super User
Super User

Hi @YouCanCallMeAl ,

 

you can merge the table 2 to table 1 using two columns. Just need to do ctrl then select your second column upon merging. 

 

Hope this helps

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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