Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi
I have two tables, Product and Price change; I want to add a column in the product table where I can see the product's last price change date using the meger query. Where the product has a unique barcode, but the price change table barcode is not unique as its changes frequently.
product table -
Barcode | Name | Price |
123 | A | 10 |
124 | B | 14 |
Price change-
Barcode | name | Price | Change date |
123 | A | 9 | 10/10/22 |
123 | A | 10 | 11/11/22 |
124 | B | 12 | 10/10/22 |
124 | B | 14 | 11/11/22 |
Desired Table
Barcode | name | Price | Change date |
123 | A | 10 | 11/11/22 |
124 | B | 14 | 11/11/22 |
Thanks
Mahfuz
Solved! Go to Solution.
[Last Change Date] = // calc column in Products
var CurrentBarcode = Products[Barcode]
var LastChangeDate =
MAXX(
filter(
'Price Change',
'Price Change'[Barcode] = CurrentBarcode
),
'Price Change'[Change Date]
)
return
LastChangeDate
[Last Change Date] = // calc column in Products
var CurrentBarcode = Products[Barcode]
var LastChangeDate =
MAXX(
filter(
'Price Change',
'Price Change'[Barcode] = CurrentBarcode
),
'Price Change'[Change Date]
)
return
LastChangeDate