Forum Discussion
Pulling multiple columns from one (query, tables) into another according to multiple conditions
- 3 years ago
Hi @HMK
I've updated the PBIX for you in the attached. I've done it all in Power Query by creating a new key and then Appending the tables into a new table. PBIX file is attached.
The appended table (new table) looks like below. You can change / adjust as you want in Power Query, too, by just deleting whatever columns, etc, you don't want.
Let me know if you need anything else 🙂
Theo
Hi,
Try these calculated column formulas in T1
First = Left('T1'[P02])
P05 value = calculate(max('T2'[P05]),filter('T2','T2'[P00]=earlier('T1'[P00])&&'T2'[P01]=earlier('T1'[P01])&&'T2'[P02]=earlier('T1'[First])))
Hope this helps.
Ashish_Mathur thank for your proposal but it doesn't works because I have a text value in 'T2'[P05] so how can I get the exact value of P05 or find first instead of calculat max?
Thanks in advance.
T2T1
- Ashish_Mathur3 years ago
Super User
It should still work. If it does not, then share the download link of the PBI file.
- Ashish_Mathur3 years ago
Super User
- HMK3 years agoRegular Visitor
It doesn't work correctly, because the 3rd row in T2 shall match the 11th row in T1 according to the condition but it seems it's blank.
For the latest part of the condition can I write if insted of making matching betwen the two columns (Left('T1'[P02]) = 'T2'[P02]) can I write the values in the formula directly e,g: Left('T1'[P02]) = "acd" or "zip"..etc. ?
T1T2- Ashish_Mathur3 years ago
Super User