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

Take max of date by column

Hi,

 

I have a dataset attached below : 

 

DealerDateMaturityOutput DateOutput Maturity
H10002018-01-01Low2018-01-04High
H10002018-01-02Medium2018-01-04High
H10002018-01-03High2018-01-04High
H10002018-01-04High2018-01-04High
N05002018-03-06Low2018-03-08Medium
N05002018-03-07Low2018-03-08Medium
N05002018-03-08Medium2018-03-08Medium

 

I want to calculate max date for each dealer name and

the output should have a single maturity and single date for each dealer.

Output column is attached.

 

Please help

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous

 

Please try the below coding to see if this can meet your requirements.Thanks.

 

Column = MAXX(FILTER(Sheet33,Sheet33[dealer]=EARLIER(Sheet33[dealer])),'Sheet33'[DATE])
Column 2 = 
VAR MAXDATE = MAXX(FILTER(Sheet33,Sheet33[dealer]=EARLIER(Sheet33[dealer])),'Sheet33'[DATE])
RETURN MAXX(FILTER('Sheet33',Sheet33[dealer]=EARLIER(Sheet33[dealer])&&'Sheet33'[DATE]=MAXDATE),Sheet33[Maturity])

c1.JPG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@Anonymous

 

Please try the below coding to see if this can meet your requirements.Thanks.

 

Column = MAXX(FILTER(Sheet33,Sheet33[dealer]=EARLIER(Sheet33[dealer])),'Sheet33'[DATE])
Column 2 = 
VAR MAXDATE = MAXX(FILTER(Sheet33,Sheet33[dealer]=EARLIER(Sheet33[dealer])),'Sheet33'[DATE])
RETURN MAXX(FILTER('Sheet33',Sheet33[dealer]=EARLIER(Sheet33[dealer])&&'Sheet33'[DATE]=MAXDATE),Sheet33[Maturity])

c1.JPG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi,

 

Im new to power bi, could you please explain how does earlier operate. The documentation is confusing

@Anonymous,

 

You may check post below.

https://community.powerbi.com/t5/Desktop/This-Function/m-p/326489#M145679

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

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.