Forum Discussion
Lookup target from another table
- 9 years ago
Hi Anonymous,
In DimTarget, the start and end time including whole month, so you can use month to identify the date. I reproduece your scenario and get expected result.
Create month column in tblActivity and DimTarget table using the formulas.month = MONTH(tblActivity[Date]) month = MONTH(DimTarget[DateStart])
Then you can use LOOKUP function. You look up DimTarget[target] when tblActivity[Activity] equals DimTarget[Activity], and tblActivity[month] equals DimTarget[month].target = LOOKUPVALUE(DimTarget[Target],DimTarget[Activity],tblActivity[Activity],DimTarget[month],tblActivity[month])
If you have other issues, don't hesitate to let me know.
Best Regards,
Angelia
Hi Anonymous,
In DimTarget, the start and end time including whole month, so you can use month to identify the date. I reproduece your scenario and get expected result.
Create month column in tblActivity and DimTarget table using the formulas.
month = MONTH(tblActivity[Date]) month = MONTH(DimTarget[DateStart])
Then you can use LOOKUP function. You look up DimTarget[target] when tblActivity[Activity] equals DimTarget[Activity], and tblActivity[month] equals DimTarget[month].
target = LOOKUPVALUE(DimTarget[Target],DimTarget[Activity],tblActivity[Activity],DimTarget[month],tblActivity[month])
If you have other issues, don't hesitate to let me know.
Best Regards,
Angelia