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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
nickelcap
Frequent Visitor

Filtering to Latest Time Stamp

Hi Everyone,

 

I'm having an issue with filtering by the latest time stamp in Power BI Desktop. I used the method outlined by Lukasz Pawlowski here: https://blogs.msdn.microsoft.com/lukaszp/2015/08/08/finding-the-latest-date-in-power-bi-desktop/.

 

I've used this method in the past on a different dataset and it works exactly as I want it to. However, when I tried to implement it with a new dataset I found that instead of finding the latest for each category it found the latest for the entire date and time column. I checked and all the syntax is the exact same, aside from me changing the table and column references. 

 

I suspect that the issue is the structure of my data, but I can't figure out what it is. Strangely, if I make a table with the MaxDate measure and one of the other category columns (ex. name) the latest dates for each name are shown. So, I believe that that calculation is good.

 

Any suggestions on how to troubleshoot this? I'm kind of at a loss since the exact same method worked fine for me before.

 

Thanks,

 

Dan 

1 ACCEPTED SOLUTION

@nickelcap

 

Please take a look at below screenshot, I don’t have the problem you mentioned above. Are you using the latest Version: 2.36.4434.381 64-bit (June 2016)?

Filtering to Latest Time Stamp_3.jpg

 

Best Regards,
Herbert

View solution in original post

4 REPLIES 4
v-haibl-msft
Microsoft Employee
Microsoft Employee

@nickelcap

 

According to your description, I create a dataset and create two columns as below. Not sure if it is what you want.

If you still have issues with this, could you please provide some sample data and expected output result?

 

Filtering to Latest Time Stamp_1.jpg

 

Latest_in_Group = 
IF (
    Table1[Date]
        = CALCULATE ( MAX ( Table1[Date] ), ALLEXCEPT ( Table1, Table1[Group] ) ),
    "Group Latest"
)
Latest_in_Name = 
IF (
    Table1[Date]
        = CALCULATE ( MAX ( Table1[Date] ), ALLEXCEPT ( Table1, Table1[Name] ) ),
    "Name Latest"
)

Filtering to Latest Time Stamp_2.jpg

 

Best Regards,
Herbert

Hi Herbert,

 

Thank you very much for the suggestion. I attempted to implement it, however I did not seem to quite get the output I was hoping for. Here's a snip of what I'm looking at:

 

 

ExampleExample

 

You can see that for 00011117 the 'Group Latest' is for an earlier time stamp (2016/07/15 2:17:38 AM) than the true latest time stamp (2016/07/15 6:17:36 AM). Looking at my other report, it looks like the time stamps I was working with only had the date. Could adding time to the mix be causing the issue?

 

Thanks,

 

Dan

@nickelcap

 

Please take a look at below screenshot, I don’t have the problem you mentioned above. Are you using the latest Version: 2.36.4434.381 64-bit (June 2016)?

Filtering to Latest Time Stamp_3.jpg

 

Best Regards,
Herbert

Hi Herbert, 

 

Yes, I am using the latest version of Power BI Desktop. I made sure that I had the same syntax you showed, and realized that for the last column reference I had managed to select the wrong column! My mistake. The formula is now working as desired.

 

Thank you very much!

 

Dan

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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