Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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