Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
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
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
112 | |
105 | |
94 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |