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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.