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
bilingual
Helper V
Helper V

MAX DATE from One to Many relationsship

Hi i have some trouble making MAX DATE work. 

I have a sheet with a unique ID and a sheet with multiple IDs , where i need to latest date to show up per each unique ID in the unique sheet.

I tried with MAX to no avail, it gives me the max date without taking into account the relationship, so all Unique IDs get the same date.

The sheets are connected with a one to many relationsship-

 

 

1 ACCEPTED SOLUTION

Hi, @bilingual 

 

You can simply modify the column.

Like:

Column = MAXX(FILTER(Table1,[ID]=EARLIER(Table2[ID])&&[Type]="Flex"),[Date])

 

Best Regards

Janey Guo

 

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

7 REPLIES 7
v-janeyg-msft
Community Support
Community Support

Hi, @bilingual 

 

You can easliy create a measure or calculated column to display the result.

Like this:

Measure = MAXX(FILTER(ALL(Table1),[ID]=SELECTEDVALUE(Table2[ID])),[Date])
Column = MAXX(FILTER(Table1,[ID]=EARLIER(Table2[ID])),[Date])

3.png

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

Thanks Janey, it works perfectly, if i want to add an extra filter on it, could you be so kind to advise me for adding it to the Column ?

 

Column = MAXX(FILTER(Table1,[ID]=EARLIER(Table2[ID])),[Date])

 

Filter "Type" in Table1

 

Thanks

Hi, @bilingual 

 

I have written both column and measure methods, you can use them according to your needs. And I don't have your sample data, so I don't know what you mean about 'Filter "Type" in Table1'. Can you explain it?

 

Best Regards

Janey Guo

 

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

Sorry for my bad explanation, i need one more condition for Max date, from Table1 there is a column named "Type" and only when Type="Flex" should maxdate be present

Hi, @bilingual 

 

You can simply modify the column.

Like:

Column = MAXX(FILTER(Table1,[ID]=EARLIER(Table2[ID])&&[Type]="Flex"),[Date])

 

Best Regards

Janey Guo

 

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

Thanks a lot, you helped me a lot!

Anonymous
Not applicable

New Measure
MaxDate = IF(CALCULATE(MAX(Table1[Date]),ALLEXCEPT(Table1,Table1[UniqueId]))=MAX(Table1[Date])
,1,0)
I hope this might work for your requirement .

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.