Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone,
I'm trying to find a solution for the following issue.
I have two tables:
Salesinvoice (salesdate, articlenumber)
Purchaseinvoice (purchasedate, articlenumber, purchaseprice)
I'm trying to create a measure in Salesinvoice that, based on the salesdate, selects the latest purchaseprice.
So, the salesdate >= purchasedate && MAX(purchasedate).
Can someone please help me?
Solved! Go to Solution.
Hi @Anonymous
You may use below measure. Show the simplified sample as below:
LatestPrice = CALCULATE ( MAX ( Purchaseinvoice[purchaseprice] ), TOPN ( 1, FILTER ( Purchaseinvoice, Purchaseinvoice[articlenumber] = MAX ( Salesinvoice[articlenumber] ) && Purchaseinvoice[purchasedate] <= MAX ( Salesinvoice[salesdate] ) ), Purchaseinvoice[purchasedate], DESC ) )
Regards,
Cherie
Hi @Anonymous
You may use below measure. Show the simplified sample as below:
LatestPrice = CALCULATE ( MAX ( Purchaseinvoice[purchaseprice] ), TOPN ( 1, FILTER ( Purchaseinvoice, Purchaseinvoice[articlenumber] = MAX ( Salesinvoice[articlenumber] ) && Purchaseinvoice[purchasedate] <= MAX ( Salesinvoice[salesdate] ) ), Purchaseinvoice[purchasedate], DESC ) )
Regards,
Cherie
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
99 | |
76 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |