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
StefanM
Helper II
Helper II

Filter ID to most recent Date / Time / Timezone

Hello everyone! Im having some difficulty filtering one of my datasets.

Basically, I have a table with a bunch of non-unique IDs with various dates associated with them.
I want to make the IDs unique, retaining only the most recent Date / Time / Timezone row.

To help explain a little more, this is what I have atm:

 

Data Type: 123Data Type: Date / Time / Timzone
2225/05/2019 01:03:28 +00:00
2325/05/2019 02:03:28 +00:00
2325/05/2019 03:03:28 +00:00
2425/05/2019 04:03:28 +00:00
2525/05/2019 05:03:28 +00:00
2625/05/2019 06:03:28 +00:00
2625/05/2019 07:03:28 +00:00
2625/05/2019 08:03:28 +00:00
2625/05/2019 09:03:28 +00:00

 

And this is what I want to end up with:

 

Data Type: 123Data Type: Date / Time / Timzone
2225/05/2019 01:03:28 +00:00
2325/05/2019 03:03:28 +00:00
2425/05/2019 04:03:28 +00:00
2525/05/2019 05:03:28 +00:00
2625/05/2019 09:03:28 +00:00


Any ideas?

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @StefanM ,

By my tests, there are two ways for us to achieve your desired output.

1. Create the dax measure with the formula below.

Measure =
CALCULATE (
    MAX ( 'Table'[Data Type: Date / Time] ),
    ALLEXCEPT ( 'Table', 'Table'[Data Type: 123] )
)

2. Change the Field Data Type: Date / Time to be Latest like below.

Untitled.png

Hope this can help you.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
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-piga-msft
Resident Rockstar
Resident Rockstar

Hi @StefanM ,

By my tests, there are two ways for us to achieve your desired output.

1. Create the dax measure with the formula below.

Measure =
CALCULATE (
    MAX ( 'Table'[Data Type: Date / Time] ),
    ALLEXCEPT ( 'Table', 'Table'[Data Type: 123] )
)

2. Change the Field Data Type: Date / Time to be Latest like below.

Untitled.png

Hope this can help you.

Best Regards,

Cherry

 

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

@StefanM 

When I need to filter to the last date/time, I usually complete that within Power Query during the ETL process using the Group by function.

In Query editor, group IDs by Max Date and Time and that should clean up the information for you. 

If you need to maintain the entire list as well, reference the original query ( to save memory and load time as your queries grow) and perform the grouping on that particular query. The IDs then become unique and can  be used to filter your original query.





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

Proud to be a Super User!




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.