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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PBI_newuser
Post Prodigy
Post Prodigy

how to bring the field to from one table to another by matching year and product column

Hi,

 

How to lookup Sales field to "Hours" table by matching both "FY" and "Product"?

Capture.PNG

 

https://wetransfer.com/downloads/1d0562a2689734545d1256f4c9b9410f20201229060942/7103ecfb2d8bbbac6a78...

1 ACCEPTED SOLUTION
sanalytics
Super User
Super User

Hello @PBI_newuser ,

 

Create a virtual relationship between two tables..

 

Use below dax

Sales = CALCULATE(
SUM(Sales[Sales]),
TREATAS(VALUES(Hours[FY]),Sales[FY]),
TREATAS(VALUES(Hours[Product Group]),Sales[Product]))
 
sanalytics_0-1609226562719.png

 

 
Attached is the Power Bi file
 
Hope it will help
Regards
Sanalytics

 

View solution in original post

3 REPLIES 3
sanalytics
Super User
Super User

Hello @PBI_newuser ,

 

Create a virtual relationship between two tables..

 

Use below dax

Sales = CALCULATE(
SUM(Sales[Sales]),
TREATAS(VALUES(Hours[FY]),Sales[FY]),
TREATAS(VALUES(Hours[Product Group]),Sales[Product]))
 
sanalytics_0-1609226562719.png

 

 
Attached is the Power Bi file
 
Hope it will help
Regards
Sanalytics

 

amitchandak
Super User
Super User

@PBI_newuser , Create a new column in hours table like

 

sumx(filter(sales, sales[product] = hours[product] && sales[FY] = hours[FY]), sales[sales])

refer : https://www.youtube.com/watch?v=czNHt7UXIe8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
rajulshah
Resident Rockstar
Resident Rockstar

Hello @PBI_newuser ,

 

You can use LOOKUPVALUE to achieve this.

Maybe this link can help you further.

Hope this helps.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors