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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.