Hello,
I have two fact tables, with different measures/info that I would like to combine into one table.
Both fact tables have a column batch number which is the same in both tables, but there are multiple lines per table for each batch.
Is it possible to create a lookup or columns based on the batch numbers, using treatas/summarise/add columns?
PBIX and sample of desired result below. Much appreciated
Results_Test.pbix (549.0 KB)
Sample Desired Result.xlsx (23.3 KB)
Tables to Combine
Final Result Table =
VAR Batch_Number_Result_Table =
CALCULATE (
MAX ( Test_Attribute_Results[Batch Number] ),
Test_Attribute_Results[Batch Number] <> “Blank”
)
VAR LCode =
CALCULATE (
SELECTEDVALUE ( Procurement[Vendor] ),
Test_Attribute_Results[Batch Number] = Batch_Number_Result_Table
)
VAR Vendor =
CALCULATE (
SELECTEDVALUE ( Procurement[Vendor] ),
Test_Attribute_Results[Batch Number] = Batch_Number_Result_Table
)
RETURN
ADDCOLUMNS (
SUMMARIZE (
Test_Attribute_Results,
Test_Attribute_Results[Batch Number],
Test_Attribute_Results[Attribute]
),
“Last Test Date”, [Last Test Date],
“Lastest Result”, [Latest Test Results],
“P/F”, [Pass/Fail],
“Cost/KG”, [Cost / KG],
“Weight”, [Weight (KG)],
“Vendor”, Vendor
)
Thanks for your help