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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Ashik008
Frequent Visitor

latest date column needed

Hi all,

I need help with data .

I have table with id and date data. I need a column with latest date if the id

service idcompleted date
1016/20/2024
1015/10/2023
10210/10/2023
1031/1/2023
1031/1/2024

 

i need the result 

service idcompleted datelatest complete date
1016/20/20246/20/2024
1015/10/20236/20/2024
10210/10/202310/10/2023
1031/1/20231/1/2024
1031/1/20241/1/2024

Please help me with it

1 ACCEPTED SOLUTION
AntrikshSharma
Super User
Super User

@Ashik008 

Latest Completed Date = 
CALCULATE ( 
    MAX ( 'Table'[completed date] ),
    ALLEXCEPT ( 'Table', 'Table'[service id] )
)

 

AntrikshSharma_0-1718904379115.png

 

View solution in original post

4 REPLIES 4
AntrikshSharma
Super User
Super User

@Ashik008 

Latest Completed Date = 
CALCULATE ( 
    MAX ( 'Table'[completed date] ),
    ALLEXCEPT ( 'Table', 'Table'[service id] )
)

 

AntrikshSharma_0-1718904379115.png

 

rajendraongole1
Super User
Super User

Hi @Ashik008 - you can use max function on completed date and filter based on ID with current id.

 

Calculated columns as below:

LatestCompleteDate =
VAR CurrentServiceID = ServiceData[service id]
RETURN
CALCULATE(
MAX(ServiceData[completed date]),
FILTER(
ServiceData,
ServiceData[service id] = CurrentServiceID
)
)

 

rajendraongole1_0-1718895876143.png

 

Report view:

rajendraongole1_1-1718895963947.png

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





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

Proud to be a Super User!





@rajendraongole1 hi sir ,can you share the pbix file for it. formula not working for ,me

ajohnso2
Continued Contributor
Continued Contributor

Something like this should work:

Latest Completion Date =
VAR _ServiceID = SELECTEDVALUE('YourTable'[Service ID])
VAR _DateCompleted =

FILTER(
    ADDCOLUMNS(
        CALCULATETABLE(
            ALL('YourTable'[Service ID], 'YourTable'[Date Completed])
        ),
        "@MaxCompletedDate", 'YourTable'[Date Completed]
    ),
    'YourTable'[Service ID] = _ServiceID
)

RETURN
MAXX(_DateCompleted, [@MaxCompletedDate])

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.