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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Luke_H
New Member

Multiple Costs For Same Product over time

Hi There,

 

I am wanting some help with a cost table that has the same product code but over a few years with varying costs over that time so I can correctly do some profit and margin analysis for the same products over multiple FY's. 

 

Thanks.

 

Example:

 

Product 15.0128/07/2017
Product 15.051/08/2017
Product 15.1216/05/2018
Product 15.1523/07/2018
Product 15.1825/07/2018
Product 15.213/08/2018
Product 22.315/04/2017
Product 22.409/07/2017
Product 22.4211/11/2017
Product 22.4813/04/2018
Product 22.503/02/2019
Product 30.831/02/2017
Product 30.863/06/2017
Product 30.871/12/2017
Product 30.894/05/2018
Product 30.946/10/2018
Product 30.973/03/2019

 

 

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi  @Luke_H 

Sample data and expected output would help tremendously.
Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

and if this post could meet your requirement:

https://community.powerbi.com/t5/Desktop/Need-a-column-to-show-latest-transacted-price-for-each-prod...

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

Assume this is the price table and you want to use the same in sales. These two columns can help

 

//New column in price
End date of price = minx(filter(price,price[Product]=earlier(price[Product]) && price[Date]>earlier(price[Date])),price[Date])

//new Column in sales
In sales table 
minx(filter(price,sales[Product]=price[Product] && sales[sales Date]>=price[Date] && sales[sales Date]<price[End date of price]),price[Date])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.