Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Reply
Mahfuz
Frequent Visitor

Merge product and price change table

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 -

BarcodeNamePrice
123A10
124B14

 

 

Price change-  

BarcodenamePrice Change date
123A910/10/22
123A1011/11/22
124B12

10/10/22

124B14

11/11/22

 

Desired Table

 

BarcodenamePrice Change date
123A1011/11/22
124B1411/11/22

 

 

Thanks

Mahfuz

1 ACCEPTED SOLUTION
daXtreme
Solution Sage
Solution Sage

[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

View solution in original post

1 REPLY 1
daXtreme
Solution Sage
Solution Sage

[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

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.