Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi,
I'm having trouble matching between two different tables. I'm trying to match between [Date] and [ID] columns from Table1 to Table2 and pull table2[Tool] value. Table2[Date] is equal or 1 day higher than Table1[Date].
Please see the sample data below. I'm not sure what I can do to make it work. Table1[tool] is the one I'm trying to get.
Any inputs will be greatly appreciated.
Table1 | (from table2) | Table2 | ||||||||
Date | ID | X1 | X2 | X3 | X4 | Tool | Date | ID | Tool | |
7/29/2019 | 12345 | 1.2 | 1.4 | 1.2 | 1.1 | AA | 7/30/2019 | 12345 | AA | |
7/29/2019 | 23456 | 2.0 | 1.1 | 1.2 | 1.5 | BB | 7/30/2019 | 23456 | BB | |
7/29/2019 | 23456 | 2.8 | 0.8 | 1.2 | 1.9 | BB | ||||
7/29/2019 | 53451 | 3.6 | 0.5 | 1.2 | 2.3 | BB | 7/30/2019 | 53451 | BB | |
7/28/2019 | 34567 | 4.4 | 0.2 | 1.2 | 2.7 | AA | 7/29/2019 | 34567 | AA | |
7/27/2019 | 23456 | 2.8 | 0.8 | 1.2 | 1.9 | AA | 7/27/2019 | 23456 | AA |
Solved! Go to Solution.
Hi,
There are multiple ways of solving this.
You may find one of the solutions helpful here
Rgds,
Vivek
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @EZiamslow
Can you provide a sample of what outcome you are expecting?
Hi @Mariusz
I'm trying to get value Table2[Tool] in Table1. I have it on my sample.
Hi @EZiamslow
Sorry, I've missed that.
You can do it in Query Editor by adding a custom column to the Table1.
Please see the below M code for your column.
let _id = [ID], _date = [Date] in Table.FirstN( Table.Sort( Table.SelectRows( Table2, each [ID] = _id and [Date] >= _date ), { { "Date", Order.Ascending } } ), 1 )[Tool]
Next you will need to expand the list of values.
please see the outcome below.
Let me know if you need any extra help.
Hi,
There are multiple ways of solving this.
You may find one of the solutions helpful here
Rgds,
Vivek
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @vivran22
I've tried to look at your solution, but could not find anything in the file, just row tables.
Can you republish the file?
ps. thanks for the kudos!
Hi,
I have checked the link and it is working fine. I am not sure what you are seeing when you are accessing the file. I have suggested the solution using DAX (LookupValue). Below is the screenshot:
Rgds,
Vivek
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |