Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Lookup target from another table

I am unable to figure out to create a measure so that I can lookup the target for an activity based on the date range.

 

I have two tables as below. (Even though I am just showing 3 - 4 columns here, I have many and would like to use them as filters)

 

tblActivity is my fact table which contains activies, date and value. Now I want to get the targets for those activies from my DimTarget table.

 

tblActivity
ActivityDateValue
Upsell02-Jan-1710
Cross Sell11-Jan-1712
New addition25-Jan-1714
Upsell03-Feb-1716
Cross Sell20-Feb-1720
New addition27-Feb-1721

 

DimTarget
ActivityDateStartDateEndTarget
Upsell01-Jan-1731-Jan-178
Cross Sell01-Jan-1731-Jan-179
New addition01-Jan-1731-Jan-1712
Upsell01-Feb-1728-Feb-1716
Cross Sell01-Feb-1728-Feb-1718
New addition01-Feb-1728-Feb-1724

 

Desired output..

 

Output 
ActivityDateValueTarget
Upsell02-Jan-17108
Cross Sell11-Jan-17129
New addition25-Jan-171412
Upsell03-Feb-171616
Cross Sell20-Feb-172018
New addition27-Feb-172124

 

Any help would be appreciated.

1 ACCEPTED SOLUTION
v-huizhn-msft
Microsoft Employee
Microsoft Employee

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])

 

1.PNG

 

If you have other issues, don't hesitate to let me know.

Best Regards,
Angelia

View solution in original post

1 REPLY 1
v-huizhn-msft
Microsoft Employee
Microsoft Employee

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])

 

1.PNG

 

If you have other issues, don't hesitate to let me know.

Best Regards,
Angelia

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors