Forum Discussion
Power Query Editor: custom column based on another table
- 3 years ago
I found a solution. In the SupplierTbl, I can add rows for dates between start and end dates.
(following instructions I found here: https://natechamberlain.com/2018/08/08/how-to-add-rows-for-dates-between-start-and-end-dates-in-power-bi-date-range-data/)
That way, I can merge by matching MaterialNbr, Plant code, and Date.
Bring your supplier field into the transaction table with a merge. Select both the Material number and plant code as the keys to join, then with your newly merged column you can create a new calculated column to handle the transaction date logic.
You can then delete your merged column and just have the calculated one.
- lyderic3 years agoRegular Visitor
Thank you for your help!
That's progress, but after merging, I'm getting a new column with "Table" instead of actual records. What should I do next?
An important detail: in SupplierTbl, I may have multiple records with teh same MaterialNbr and PlantCode, but different contract start date and contract end date and different supplier. For example:Material Nbr Preferred Supplier Plant code Contract start date Contract end date 123456 ABC Corp XYZ 1/1/2023 4/30/2023 123456 DEF Inc. XYZ 5/1/2023 987654 GHI & Co WER 2/1/2023