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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
UnlimitydAl
Regular Visitor

Add price to list of SKUs based on the last time that SKU was on an purchased

I'm just getting started with Power BI and DAX and need to figure out how to create a measure that shows the LastRetailPRice (BI_PurchaseOrderItems[UnitPrice]) of each SKU [BI_Products[ManufacturerCode] ] based on the last time an item with that SKU was on a purchase order (BI_PurchaseOders). The BI_Products table is related to the BI_PurchaseOrderItems table by productID and the BI_PurchaseOders table is related to BI_PurchaseOrderItems by PurchaseOrderId

 

UnlimitydAl_1-1667500969314.png

I' ve found plenty of examples doing this using 1 or 2 tables but so far I'm stuck trying to apply DAX functions where there are 3 related table

 

UnlimitydAl_2-1667501303093.png

 

 

 

 

1 REPLY 1
amitchandak
Super User
Super User

@UnlimitydAl , You need to do in two steps , two new columns 

 

New column in BI_PurchaseOrder
LAst Price =
Var _max = maxx(Relatedtable(BI_PurchaseOrderItems), BI_PurchaseOrderItems[PurchaseOrderCreated Date])
return
maxx(filter( BI_PurchaseOrderItems, BI_PurchaseOrderItems [productID] = BI_PurchaseOrder [productID] && BI_PurchaseOrderItems[PurchaseOrderCreated Date] =_max)
, BI_PurchaseOrderItems[UnitPrice])


New column in Products =
maxx(Relatedtable(BI_PurchaseOrder), [LAst Price])

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.