Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello,
I got stuck on this column creation for a while. Really hope someone could help me out here. I even start to doubt if what I want to achieve is doable in power bi or not....
What I want to achieve:
It can be in two columns since these are two different requests there.
@muhammad_786_1 I couldn't upload files but I copied and pasted my sample file here. You can copy and paste over and import into your power bi desktop? Sorry for all the trouble. Thanks in advance!!!
Sample table:
Plant | Material | Movement type | Purchase order | Item | key | Posting Date | Quantity |
6417 | 0-810-030-805 | 351 | 4000121095 | 70 | 0-810-030-805400012109570 | 3/13/2024 | 8.00 |
6417 | 0-810-030-805 | 352 | 4000121095 | 70 | 0-810-030-805400012109570 | 3/13/2024 | -1.00 |
6417 | 0-810-030-805 | 351 | 4000121095 | 70 | 0-810-030-805400012109570 | 8/8/2023 | 3.00 |
6417 | 0-810-034-517 | 351 | 4000121095 | 90 | 0-810-034-517400012109590 | 8/7/2023 | 1.00 |
6602 | 0-810-015-654 | 351 | 4000121902 | 10 | 0-810-015-654400012190210 | 9/5/2023 | 2.00 |
6602 | 0-810-015-654 | 351 | 4000121902 | 10 | 0-810-015-654400012190210 | 11/8/2023 | 3.00 |
6602 | 0-810-015-619 | 351 | 4000121902 | 100 | 0-810-015-6194000121902100 | 10/3/2023 | 2.00 |
6602 | 0-810-018-910 | 351 | 4000121902 | 210 | 0-810-018-9104000121902210 | 10/18/2023 | 4.00 |
6602 | 0-810-020-807 | 351 | 4000121902 | 220 | 0-810-020-8074000121902220 | 10/18/2023 | 3.00 |
6602 | 0-810-018-908 | 351 | 4000121902 | 230 | 0-810-018-9084000121902230 | 10/18/2023 | 12.00 |
6602 | 0-810-018-908 | 352 | 4000121902 | 230 | 0-810-018-9084000121902230 | 10/19/2023 | -6.00 |
6602 | 0-810-018-908 | 351 | 4000121902 | 230 | 0-810-018-9084000121902230 | 11/2/2023 | 6.00 |
6482 | 0-810-037-471 | 351 | 4000122926 | 10 | 0-810-037-471400012292610 | 10/9/2023 | 1.00 |
6509 | 0-810-037-471 | 351 | 4000122926 | 10 | 0-810-037-471400012292610 | 10/9/2023 | -1.00 |
What I want to achieve:
Plant | Material | Movement type | Purchase order | Item | key | Posting Date | Quantity | Target Column 1 | Target Column 2 |
6417 | 0-810-030-805 | 351 | 4000121095 | 70 | 0-810-030-805400012109570 | 3/13/2024 | 8.00 | Delete | |
6417 | 0-810-030-805 | 352 | 4000121095 | 70 | 0-810-030-805400012109570 | 3/13/2024 | -1.00 | Keep | |
6417 | 0-810-030-805 | 351 | 4000121095 | 70 | 0-810-030-805400012109570 | 8/8/2023 | 3.00 | Keep | |
6417 | 0-810-034-517 | 351 | 4000121095 | 90 | 0-810-034-517400012109590 | 8/7/2023 | 1.00 | Keep | |
6602 | 0-810-015-654 | 351 | 4000121902 | 10 | 0-810-015-654400012190210 | 9/5/2023 | 2.00 | Keep | |
6602 | 0-810-015-654 | 351 | 4000121902 | 10 | 0-810-015-654400012190210 | 11/8/2023 | 3.00 | Keep | |
6602 | 0-810-015-619 | 351 | 4000121902 | 100 | 0-810-015-6194000121902100 | 10/3/2023 | 2.00 | Keep | |
6602 | 0-810-018-910 | 351 | 4000121902 | 210 | 0-810-018-9104000121902210 | 10/18/2023 | 4.00 | Keep | |
6602 | 0-810-020-807 | 351 | 4000121902 | 220 | 0-810-020-8074000121902220 | 10/18/2023 | 3.00 | Keep | |
6602 | 0-810-018-908 | 351 | 4000121902 | 230 | 0-810-018-9084000121902230 | 10/18/2023 | 12.00 | Delete | |
6602 | 0-810-018-908 | 352 | 4000121902 | 230 | 0-810-018-9084000121902230 | 10/19/2023 | -6.00 | Keep | |
6602 | 0-810-018-908 | 351 | 4000121902 | 230 | 0-810-018-9084000121902230 | 11/2/2023 | 6.00 | Keep | |
6482 | 0-810-037-471 | 351 | 4000122926 | 10 | 0-810-037-471400012292610 | 10/9/2023 | 1.00 | Keep | |
6509 | 0-810-037-471 | 351 | 4000122926 | 10 | 0-810-037-471400012292610 | 10/9/2023 | -1.00 | Delete |
Have been stuck here for 2 days now. Any help will be appreciated!
Solved! Go to Solution.
Hi @EmmaLiuLiu - Please check the below calculated column for Target column2
Replace with your table name, Hope this works.
Proud to be a Super User! | |
Hi @EmmaLiuLiu - Create a Calculated Column for Target Column 1 compare each row's Quantity with other rows having the same Key but different Plant values and opposite Quantity signs. replace the tablename as per your model.
Proud to be a Super User! | |
Hi @rajendraongole1 , thank you so much for your help!
The first target column works. However, the second one doesn't work. I spent quite a long time myself to dig into it since my post was marked as spam. I figured one of my requests won't be solved using power dax. If two or more records have the same date and everything else is the same except the movement type (2 with 351 and 1 with 352) and or tracking info that I didn't include in the sample data, I only need to delete one of them. I need to go in there, read the tracking info and identify which record to be deleted. Is there a dax can do this job?
Hi @EmmaLiuLiu - Please check the below calculated column for Target column2
Replace with your table name, Hope this works.
Proud to be a Super User! | |
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
103 | |
99 | |
98 | |
38 | |
37 |
User | Count |
---|---|
151 | |
121 | |
73 | |
71 | |
63 |