Forum Discussion
Approximate Match for Date
- 7 years ago
Hi,
Actually Found the solution by ourselves>
Had to do two columns to achieve this, first find the approximate date [kind of vlookup true] and then find the corrosponding rate [kindof vlookup false]
Date 2 = CALCULATE(LASTNONBLANK(Rate[Date].[Date],1),FILTER(Rate,Rate[Date].[Date]<=Data[Date].[Date]))
and
Rate = CALCULATE(SUM(Rate[Rate]),FILTER(Rate,Rate[Date].[Date]=Data[Date 2].[Date]))
Thanks,
Sami
Hi samihuq,
Do you want to compare the rate on the same day in TableA and TableB to check if they are matched? If so, you could use LOOKUPVALUE function to refer to 'TableA'[Rate] column in TableB.
New Column =
IF (
TableB[Rate] = LOOKUPVALUE ( TableA[Rate], TableA[Date], TableB[Date] ),
"Matched",
"Not Matched"
)
Best regards,
Yuliana Gu
Hi,
Actually Found the solution by ourselves>
Had to do two columns to achieve this, first find the approximate date [kind of vlookup true] and then find the corrosponding rate [kindof vlookup false]
Date 2 = CALCULATE(LASTNONBLANK(Rate[Date].[Date],1),FILTER(Rate,Rate[Date].[Date]<=Data[Date].[Date]))
and
Rate = CALCULATE(SUM(Rate[Rate]),FILTER(Rate,Rate[Date].[Date]=Data[Date 2].[Date]))
Thanks,
Sami