Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

MAX Date for each repetitive id

Hey,

My table follows this structure:

idDateStatus
1 14/02/2021   ERROR
1 19/06/2020 OK
2 30/05/2021 OK
3 16/01/2021 OK
3 22/04/2021 ERROR
4 29/12/2020 OK

As you can see, each id can have more than one row, but always with different dates.
I want to create a calculated table only with the rows where the year is equal to the current year and get only the MAX DATE of each id. So the calculated table on the table above should be:

idDateStatus
1 14/02/2021 ERROR
2 30/05/2021 OK
3 22/04/2021 OK

 

How can I do this?

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

Create a table as follows:

FILTER(
	Table1,
	year(Table1[Date]) = year(TODAY()) &&
	CALCULATE(	
		max(Table1[Date]),
		ALLEXCEPT(table1,Table1[id])
	) = Table1[Date]
	
)

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

1 REPLY 1
Fowmy
Super User
Super User

@Anonymous 

Create a table as follows:

FILTER(
	Table1,
	year(Table1[Date]) = year(TODAY()) &&
	CALCULATE(	
		max(Table1[Date]),
		ALLEXCEPT(table1,Table1[id])
	) = Table1[Date]
	
)

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.