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
jwittmer9
New Member

Relationships

Hello,

I have an existing column that is an ID for my customers. I am trying to make it to where my customer ID can be interchangable with the actual name of my customer. I tried to make a relationship between the two in my query, but it didn't work. I simply want to replace my Customer ID with the actual name of my customer. Any help would be appreciated.... thanks

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @jwittmer9 ,

I created some data:

Table1:

vyangliumsft_0-1649040589856.png

Table2:

vyangliumsft_1-1649040589856.png

Here are the steps you can follow:

You can add Index to both tables in power query.

vyangliumsft_2-1649040589858.png

This way you have a relationship between your two tables.

You can then create computed columns:

Column =
CALCULATE(SUM('Table1'[ID]),FILTER(ALL(Table1),'Table1'[Index]='Table2'[Index]))

vyangliumsft_3-1649040589860.png

Or create measure.

Measure =
CALCULATE(MAX('Table2'[customer name]),FILTER(ALL(Table2),'Table2'[Index]=MAX('Table1'[Index])))

vyangliumsft_4-1649040589860.png

Please click here for the pbix file

Best Regards,

Liu Yang

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

View solution in original post

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @jwittmer9 ,

I created some data:

Table1:

vyangliumsft_0-1649040589856.png

Table2:

vyangliumsft_1-1649040589856.png

Here are the steps you can follow:

You can add Index to both tables in power query.

vyangliumsft_2-1649040589858.png

This way you have a relationship between your two tables.

You can then create computed columns:

Column =
CALCULATE(SUM('Table1'[ID]),FILTER(ALL(Table1),'Table1'[Index]='Table2'[Index]))

vyangliumsft_3-1649040589860.png

Or create measure.

Measure =
CALCULATE(MAX('Table2'[customer name]),FILTER(ALL(Table2),'Table2'[Index]=MAX('Table1'[Index])))

vyangliumsft_4-1649040589860.png

Please click here for the pbix file

Best Regards,

Liu Yang

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

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.