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
psmith-nhs-inc
Helper III
Helper III

I need the functional equivalent of a calculated column using two tables

This is a typical compound key situation.  I have an item table, and each individual item has a unique ItemSKU, and multiple Items will share a MasterSKU.

For instance T-Shirts, where each individual size and color of each shirt will have it's own ItemSKU, but all sizes and colors with the same message, or graphic, will share a Master SKU, for easy sorting and rollup.

 

I need to to break items out midway between the two, creating  a field that is MasterSKU-Color.

 

The problem is Color is not in the item table, but a separate table with a one to one match (or no match, not everything has a color associated with it) that relates on ItemSKU.

 

A measure fails:

MasterSKU-Color = min('Item'[old_sku])&"-"&min(Color[COLOR])

Works but I can't add that measure to a Matrix Row.

 

A calculated column can't cross tables.

 

I can add color to the item table sql upon load if I have to, but I am wondering if there is a better way to achieve this within Power BI?

Phil

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

@psmith-nhs-inc,

 

Hi Phil,

 

You can try this formula. Make sure relationship is established.

 

MasterSKU-Color =
'ITEM'[old_sku] & "-"
    & RELATED ( COLOR[color] )

I need the functional equivalent of a calculated column using two tables.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

 

 

Community Support Team _ Dale
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

2 REPLIES 2
v-jiascu-msft
Employee
Employee

@psmith-nhs-inc,

 

Hi Phil,

 

You can try this formula. Make sure relationship is established.

 

MasterSKU-Color =
'ITEM'[old_sku] & "-"
    & RELATED ( COLOR[color] )

I need the functional equivalent of a calculated column using two tables.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

 

 

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

That did it.  Thank you very much.

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.