cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kraj
New Member

Calc column from column in other table

Hi all,

 

I am new to Power Bi, and I hope someone can help solve my little headache explained below

 

I have Table 1 and table 2, and I wish to calculate a new column in table 2 based on table 1.

 

The new column should contain the maximum cost value form Table 1 as illustrated in the example below.

 

Can anyone help?

 

Table 1

NameCost
LH575
LH575
LH575
GT623
GT685
GT250
SH654

 

Table 2

NameCost
LH575
GT685
SH654
1 ACCEPTED SOLUTION
FrankAT
Community Champion
Community Champion

Hi @kraj 

you can do it like this:

 

25-09-_2020_23-28-41.png

 

Max Cost = MAXX(RELATEDTABLE(Table1),Table1[Cost])

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula will work in Table2 without any relationship between the 2 tables.

=CALCULATE(MAX(Data[Cost]),FILTER(Data,Data[Name]=EARLIER(Data1[Name])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
FrankAT
Community Champion
Community Champion

Hi @kraj 

you can do it like this:

 

25-09-_2020_23-28-41.png

 

Max Cost = MAXX(RELATEDTABLE(Table1),Table1[Cost])

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

XTF_2020
Helper I
Helper I

Hello  @kraj 

 

See if this is what you need


Cost = CALCULATE(MAX(Tabela 1[Custo]), RELATEDTABLE(Tabela 1))

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!