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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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