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
WittigLyon
New Member

Getting Maximum date selected from date column

Hi everyone, i'm trying to get the latest date selected in a new column

my data is structured like;

 

Employee_name | Hire date    | Latest date

Wittig Lyon         |   1/1/2023  | 

Wittig Lyon         |   5/4/2023  |

Wittig Lyon         |   9/8/2023  |  9/8/2023

Henry                 |   31/1/2023  | 

Henry                 |   12/9/2023  |  12/9/2023

Henry                 |   1/9/2023  | 

 

i`d love to have the Latest date be populated with the latest date of each employee thereby having 9/8/2023 as the value populating the latest date column for Wittig Lyon and 12/9/2023 for Henry 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@WittigLyon , for a new column

 

New col=

var _max = maxx(filter(Table, [Employee_name] = earlier([Employee_name]) ), [Hire Date])

return

if( [Hire_date] = _Max, [Hire_date], blank())

 

For measure use

Latest
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

https://amitchandak.medium.com/power-bi-get-the-sum-of-the-last-latest-value-of-a-category-f1c839ee8...

 

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8

View solution in original post

2 REPLIES 2
Ritaf1983
Super User
Super User

Hi @WittigLyon 

Add calculated column with the formula :

last date = if('Table'[ Hire date    ]=CALCULATE(max('Table'[ Hire date    ]),ALLEXCEPT('Table','Table'[Employee_name ])),[ Hire date    ],blank())
 
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@WittigLyon , for a new column

 

New col=

var _max = maxx(filter(Table, [Employee_name] = earlier([Employee_name]) ), [Hire Date])

return

if( [Hire_date] = _Max, [Hire_date], blank())

 

For measure use

Latest
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

https://amitchandak.medium.com/power-bi-get-the-sum-of-the-last-latest-value-of-a-category-f1c839ee8...

 

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8

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.