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

Unable to solve, product code mapping related problem.

I have common problem however unable to solve using power query or DAX

Have a sales table in SQL which has product code, country of sales, day of transaction and sales amount, doesnt cotain product name. For product name we have product code mapping table in excel. 

Issue is after certain date the product names gets changed. We need to plot product name wise sales with the dates.

 

Sales table

CountryProduct CodeDate              Sales
India32562/1/2019          8,023
China955812/1/2019          6,541
India95582/1/2020          7,058
China95589/1/2020          8,165
India95589/1/2021          6,739
China955810/1/2021          7,343
India325611/1/2021          7,519
China32564/1/2022          6,944
India325611/1/2022          7,787
China95581/1/2023          8,060
India95582/1/2023          6,400

 

Mapping Table in Excel

          

Product CodeProduct nameProduct name after 9/1/2021
9558Product AProduct M
3256Product CProduct N

 

Would you please help me solve this.

Thanks

3 REPLIES 3
some_bih
Super User
Super User

Hi @Ab_2023 if you want to trace changing names for product you should provide inputs like StarDate and EndDate for each product code, depending on inputs (modeling this part in overall model) solution could be achived.

The best would be that in separate process you check if product is changed name and decide what is product name for current /alwasy and that value consider in model.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






some_bih
Super User
Super User

Hi @Ab_2023 you need to create relationship in Power BI to connect your to tables (by Product code) to leverage it later using measure

Check link for this

https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-create-and-manage-relationships 

 

Maintening product names in Product table should resolve your issues.

Did I answer your question? Mark my post as a solution! Kudos Appreciated!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Hi @some_bih, Thank you for promt response, I have already created relationship between tables, however challenges comes while writing measures because of changing names after certain dates. Could you share your Dax to resolve the issue. Thanks


Mapping.png

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.