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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Jeffrey_VC
Helper III
Helper III

Latest "Yes" based on timestamp

Hi everyone,

 

I'm trying to find a dax code for the latest yes based on timetamp.
Example data:

 

Jeffrey_VC_0-1703064482968.png

I need the latest "Yes". In the example "18-11-2022 11:12"

Can anyone help me?

Thanks in advance.

 

Jeffrey

2 ACCEPTED SOLUTIONS

Hi, @Jeffrey_VC 

try below

measure =
calculate(
  max(tablename[timestamp]),
  tablename[value]="yes",
  allexcept(tablename,tablename[timestamp]),
  tablename[deviceid]= max(tablename[deviceid])
)

View solution in original post

4 REPLIES 4
Dangar332
Super User
Super User

Hi, @Jeffrey_VC 

try below code

measure =
calculate(
  max(tablename[timestamp]),
  tablename[value]="yes",
  allexcept(tablename,tablename[timestamp])
)

Thnx for your answer.

I tried and get the latest "yes" of the total. I also have a device id.
I need for every device id the latest "yes" 😀

Hi, @Jeffrey_VC 

try below

measure =
calculate(
  max(tablename[timestamp]),
  tablename[value]="yes",
  allexcept(tablename,tablename[timestamp]),
  tablename[deviceid]= max(tablename[deviceid])
)

Works! Thnx.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors