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
chandraismoon
Employee
Employee

How to get MAX date from two records to one record

Hi All,

 

I have a data set Having same values except date column

Ex:

ID                   changed date             category

1                     1/3/2020                     Bike

1                      3/3/2020                    Bike

2                     3/3/2020                     car

2                      4/3/2020                    car

 

In this I want the out put as 

ID                   changed date             category

1                      3/3/2020                    Bike

2                      4/3/2020                    car

 

How can I achieve it 

 

Please help

 

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @chandraismoon ,

 

Try to create a measure for date column:

Max_date = 
CALCULATE(
    MAX([changed date]),
    ALLEXCEPT(
        'Sheet1 (2)',
        'Sheet1 (2)'[ID], 'Sheet1 (2)'[category]
    )
) 

dd5.PNG

Finally, you can change the data format

dd6.PNG

 

Best regards,
Lionel Chen

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

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @chandraismoon ,

 

Try to create a measure for date column:

Max_date = 
CALCULATE(
    MAX([changed date]),
    ALLEXCEPT(
        'Sheet1 (2)',
        'Sheet1 (2)'[ID], 'Sheet1 (2)'[category]
    )
) 

dd5.PNG

Finally, you can change the data format

dd6.PNG

 

Best regards,
Lionel Chen

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

niteshtrehan89
Helper III
Helper III

Hi chandraismoon,

 

We can write the DAX function to get the max date by grouping the categories.

 

test = CALCULATE(MAX(Test[Changed Date]),GROUPBY(Test,Test[Category]))

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.