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
luka_zz
Frequent Visitor

price list connectivity

Hello all,

wonder if you could help me:

 

In one table I have information about product price which has information about price and date from which the price is valid as shown below. For example product 1 had price 10,0 from January 1 2020 till February 29 2020; from March 1 till June 14 the price was 11,0 and from June 15 onwards it is 12,00.

 

 PRODUCTPRICEVALID FROM
Product 110,01.01.2020
Product 215,01.01.2020
Product 320,01.01.2020
Product 111,01.03.2020
Product 215,515.02.2020
Product 112,015.06.2020

 

In other table I have daily sales of those products.

How can I assign price information from first table to each specific date/product in the second table?

 

Thank you in advance for your support 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@luka_zz , Create a new column of price in the table like

new column =
var _max = maxx(filter(Price, price[VALID FROM] <=table[Date] && price[PRODUCT] = table[PRODUCT]),price[VALID FROM])
return
maxx(filter(Price, price[VALID FROM] =_max&& price[PRODUCT] = table[PRODUCT]),price[PRICE])

View solution in original post

2 REPLIES 2
luka_zz
Frequent Visitor

@amitchandak works perfectly, thank you very much.

amitchandak
Super User
Super User

@luka_zz , Create a new column of price in the table like

new column =
var _max = maxx(filter(Price, price[VALID FROM] <=table[Date] && price[PRODUCT] = table[PRODUCT]),price[VALID FROM])
return
maxx(filter(Price, price[VALID FROM] =_max&& price[PRODUCT] = table[PRODUCT]),price[PRICE])

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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