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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
cuongtrinh2197
Frequent Visitor

Need urgent help please!!!

Hi, can someone show me the way to bring the field Customer part number to the visual table?

 

My relationship looks fine but the error happened when I tried to bring the customer part number to the table, If the customer doesn't have a specific part number for the part they bought, the return will be our part number.

 

Please find my attachment for details:
https://shorturl.at/uI99n

1 ACCEPTED SOLUTION

@cuongtrinh2197 

pls see if this is what you want

 

Measure =
VAR _cpn=maxx(FILTER(fCustProduct,fCustProduct[Part number]=max(fSales[Part number])&& fCustProduct[Customer]=max(fSales[Customer])),fCustProduct[Customer Part Number])
return if (_cpn="",max(fSales[Part number]),_cpn)
 
11.PNG




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

Proud to be a Super User!




View solution in original post

6 REPLIES 6
ryan_mayu
Super User
Super User

i think you need to improve the data model. 

Now you can try to create a column

 

customer part number = maxx(FILTER(fCustProduct,fCustProduct[Part number]=fSales[Part number]),fCustProduct[Customer Part Number])
 
11.PNG
 
then add this column to the table visual
 
 




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

Proud to be a Super User!




Many thanks Ryan,
Is there any chance for me to use your syntax acting as a measure?
My company just empowered me to do the measure and visual table without modifying the dataset such as add a new column,...

pls try this

Measure = maxx(FILTER(fCustProduct,fCustProduct[Part number]=max(fSales[Part number])),fCustProduct[Customer Part Number])
 
11.PNG
 




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

Proud to be a Super User!




Sorry Ryan I just checked again, if you can see the measure return to the swrong result
For example, line 1, customer 1 sale order but the return value in the measure column is the part number of customer 2

Ryan, the measure return the wrong value

@cuongtrinh2197 

pls see if this is what you want

 

Measure =
VAR _cpn=maxx(FILTER(fCustProduct,fCustProduct[Part number]=max(fSales[Part number])&& fCustProduct[Customer]=max(fSales[Customer])),fCustProduct[Customer Part Number])
return if (_cpn="",max(fSales[Part number]),_cpn)
 
11.PNG




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

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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