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
PhiBu
Helper I
Helper I

Get max value of a group in a related table

Hello, 

 

i have two related tables with an 1:n relation.

Table 1: 

KeyCreated
A04.20.2020
B04.25.2020

 

Table 2: 

Key Updated
A04.22.2020
A04.25.2020
A04.29.2020
B04.26.2020
B

04.27.2020

B

04.28.2020

 

I want to add a column in Table1 with the max. date of Table2 for every key.  How can i do that? I tried something with groupby and max, but it was not working. 

 

Best regards!

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @PhiBu 

Making use of the relationship:

NewColumn = CALCULATE( MAX(Table2[Updated]) )

 Please mark the question solved when done and consider giving kudos if posts are helpful.

 Cheers 

SU18_powerbi_badge

View solution in original post

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi  @PhiBu 

You could create a column by this formula:

Column = MAXX(RELATEDTABLE('Table 2'),'Table 2'[Updated])

 

Regards,

Lin

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

@PhiBu , new column in table 1

Updated = sumx(filter(Table2, table1[key]=Table2[key]),Table2[Updated])

AlB
Super User
Super User

Hi @PhiBu 

Making use of the relationship:

NewColumn = CALCULATE( MAX(Table2[Updated]) )

 Please mark the question solved when done and consider giving kudos if posts are helpful.

 Cheers 

SU18_powerbi_badge

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.

Top Solution Authors