Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello experts,
I'm trying to pull values from column "P05" & "P07" in table 2 to table 1, if the values of the following columns "P00" & "P01" in both tables are identical, and if the values of column "P02" in table 1 begins with the value of column "P02" in table 2.
In another way:
IF 'T1'[P00] = 'T2'[P00] && 'T1'[P01] = 'T2'[P01] && Left('T1'[P02]) = 'T2'[P02], then Get values of columns 'T2'[P05] , 'T2'[P07] and insert in T1, else "null".
could you please guid me how to write it in dax?
Thanks in advance & Best regards
Solved! Go to Solution.
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
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
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
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Thanks for your great support
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.
Download the revised PBI file from here.
Hope this helps.
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. ?
Hi,
You may download the revised PBI file from here.
Hope this helps.
Thanks for your great support
You are welcome. If my reply helped, please mark it as Answer.
@HMK here is the solution you are after in the attached. Please let me know if you need anything futher mate!
You can follow the applied steps in Power Query and you will see the output is performed without the need for front-end / unnecessary coding which ensures a far more efficient outcome than you would otherwise experience when using DAX.
Do not hesitate to touch base with any other questions.
Theo 🙂
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
It should still work. If it does not, then share the download link of the PBI file.
Hi @TheoC ,
I updated the post and added some photos, also below you can find the example file from my drive.
need to use left because the 'T2'[P02] will containt the purschase code and 'T1'[P02] contains purchase code, date, city without cooma or space.
can I make the number of charecters in left statment equal to the number of charecters in 'T2'[P02] eg, LEFT ( 'T1'[P02] = 'T2'[P02], Len('T2'[P02])?
could you please check if this formula would be fine?
https://drive.google.com/drive/folders/1GFoD36fzRmCZ73O9Xwgs4dXceEvJleiL?usp=sharing
pull eact value of 'T2'[P05] and 'T2'[P07] to T1 IF
'T1'[P00] = 'T2'[P00] && 'T1'[P01] = 'T2'[P01] && (Left('T1'[P02]) = 'T2'[P02],Len('T2'[P02])), then Get values of columns 'T2'[P05] , 'T2'[P07] and insert in T1, else "null".
Thanks in advance
Hi @HMK
Just a heads up, it might be easier to answer your question with some sample data and by following these prompts: https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/2066986#M7710...
In terms of your formula, is there a reason that the last AND condition is LEFT ( 'T1'[P02] = 'T2'[P02]... ? Normally the "LEFT" would require you to add 1) a number of characters and 2) a closing bracket ) to end it.
If you can provide some sample data, it may be easier to provide a response.
Cheers in advance!
Theo
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
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
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
96 | |
75 | |
63 | |
62 |
User | Count |
---|---|
135 | |
105 | |
104 | |
80 | |
65 |