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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.