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
Anonymous
Not applicable

How can I add between these two different tables?

I have these 2 tables, Apriso Lots (MM12) and Apriso Lots (MM24), I am trying to find a way to add certain columns where they would have a matching key. This is a picture of how the data model looks like. Thank you!

jostho99_0-1651712376125.png

 

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

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create calculated column.

 

Total =
var _MM12TOTAL=CALCULATE(SUM('Aprisolots (MM12)'[ProductionTotal]),
FILTER(ALL('Aprisolots (MM12)'),'Aprisolots (MM12)'[Equipment]=EARLIER('Aprisolots (MM24)'[Equipment])&&'Aprisolots (MM12)'[ProductNo]=EARLIER('Aprisolots (MM24)'[ProductNo])))
return
_MM12TOTAL + 'Aprisolots (MM24)'[ProductionTotal]

 

2. Result:

vyangliumsft_0-1652159168424.png

 

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

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create calculated column.

 

Total =
var _MM12TOTAL=CALCULATE(SUM('Aprisolots (MM12)'[ProductionTotal]),
FILTER(ALL('Aprisolots (MM12)'),'Aprisolots (MM12)'[Equipment]=EARLIER('Aprisolots (MM24)'[Equipment])&&'Aprisolots (MM12)'[ProductNo]=EARLIER('Aprisolots (MM24)'[ProductNo])))
return
_MM12TOTAL + 'Aprisolots (MM24)'[ProductionTotal]

 

2. Result:

vyangliumsft_0-1652159168424.png

 

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

Anonymous
Not applicable

@jsaunders_zero9 Thank you for the fast reply! So the two tables do not have a direct relationship but they do have similarties. They both contain [Equipment] and [ProductNo] fields. I am trying to get the sum of the production totals from each table. For example, in the image below you can see that both tables have the same [Equipment] and [ProductNo] fields, what I am trying to do is add that 421598 to 248299 to get a sum of 669897.

jostho99_0-1651715517350.png

 

jsaunders_zero9
Responsive Resident
Responsive Resident

Is there a relationship that can be created between the two tables? If there is you can add columns using RELATED() function. If no relationship then LOOKUP() should help.

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.