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
admin11
Memorable Member
Memorable Member

How to bring pro_class_desc field from sales table to inventory table ?

 

 

Hi All

 

My inventory table only have pro_class don’t have pro_class_desc

 

But my sales Table have both pro_class and pro_class_desc

 

My question is what is the best approach to make inventory table have pro_class_desc ?

 

Inventory Table :-

stock_code......pro_class......

1.........................1111

2.........................2222

3.........................3333

 

Sales Table :-

stock_code......pro_class......pro_class_desc......

1.........................1111................Terminal Block

1.........................1111................Terminal Block

1.........................1111................Terminal Block

2.........................2222................Servo Motor

2.........................2222................Servo Motor

2.........................2222................Servo Motor

3.........................3333................PLC

3.........................3333................PLC

3.........................3333................PLC

3.........................3333................PLC

 

Final Result expected :-

 

Inventory Table :-

 

stock_code......pro_class......pro_class_desc......

1.........................1111................Terminal Block

2.........................2222................Servo Motor

3.........................3333................PLC

 

Paul

7 REPLIES 7
v-lionel-msft
Community Support
Community Support

Hi @admin11 ,

 

Please refer to the formula.

Column = 
LOOKUPVALUE(
    'Sales Table'[pro_class_desc],
    'Sales Table'[stock_code], 'Inventory Table'[stock_code],
    'Sales Table'[pro_class], 'Inventory Table'[pro_class]
)

v-lionel-msft_0-1614060577149.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@v-lionel-msft 

Hi All

Can some one share with me where go wrong on the below expression , it does not work .

Paul

@v-lionel-msft 

I also try to change sales and inventory table product class code to text format , it still get the same error.

Paul 

@v-lionel-msft Thank you very much for sharing with me the approach.

Both my sales and inventory table the stock code format is text. for example stock code = N1234

Both sales and inventory product class code format is whole number. 

I get below error msg :- 

admin11_0-1614062978193.png

May i know where go wrong ?

Paul

parry2k
Super User
Super User

@admin11 I believe these two tables have a relationship and it is "one to many" relationships, one on the inventory side and many on the sales side, is this correct?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi All

 

Thank you for your sharing. I am not sure about your question. 

 

Below is my sales table.

admin11_0-1613888854682.png

Below is my Inventory Table :-

admin11_1-1613888973169.png

 PBi file :-

https://www.dropbox.com/s/sdeo7hjluuye4u2/PBT_V2021_313%20LINK%20PRODUCT%20CLASS.pbix?dl=0

 

Paul

 

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.