The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
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 , 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])
User | Count |
---|---|
11 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
22 | |
14 | |
14 | |
9 | |
7 |