Forum Discussion
Calculating column values based on date match between tables
- 6 years ago
Hi Anonymous ,
here are two calc Columns that I think do the trick
last Cal Xq val = var serial = [Serial] var calDate = [QC Date] var maxDate = CALCULATE(MAX('Calibration'[Cal Date]), FILTER(Calibration, Calibration[Serial] = 'QC'[Serial] && Calibration[Cal Date] <= calDate )) return CALCULATE(MAX('Calibration'[Cal Xq]), FILTER('Calibration', Calibration[Serial] = serial && Calibration[Cal Date] = maxDate))var = DIVIDE([QC Xq], [last Cal Xq val])-1Hope this Helps
Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!
Hi Anonymous,
What is the difference between the RECORDS_AD and RECORDS_RP Tables? Is RECORDS_RP[Xq] a calculation that references RECORDS_AD[Xq]?
Apologies, I should have made the language consistent with the example above - RECORDS_AD is essentially the Calibration table ("AD" for calibration "adjustment"), and RECORDS_RP is the QC table (RP for "routine performance" check); so my intent is to calculate the difference between each RECORDS_RP[Xq] and the corresponding RECORDS_AD[Xq] from the last calibration adjustment date.
Sorry for the confusion!
- richbenmintz6 years agoResident Rockstar
Hi Anonymous,
Can you provide a sample pbix with the error?