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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
topazz11
Helper III
Helper III

max date

I need help for this DAX...I created to get max date from the timestamps, but it gives me date with 12:00 AM.

How can I get the exact same date?

Thanks,

 

t1.JPG

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @topazz11 ,

 

We can use two ways to meet your requirement.

 

  1. Create a measure using DATE function,
Measure =
VAR a =
    DATE ( YEAR ( MAX( 'Table'[ingestion_ts] ) ), MONTH ( MAX ( 'Table'[ingestion_ts] ) ), DAY ( MAX ( 'Table'[ingestion_ts] ) ) )
VAR b =
    CALCULATE (
        MAX ( 'Table'[ingestion_ts] ),
        FILTER (
            ALLSELECTED('Table'),
            DATE ( YEAR (  'Table'[ingestion_ts]  ), MONTH (  'Table'[ingestion_ts]  ), DAY ( 'Table'[ingestion_ts]  ) ) = a
        )
    )
RETURN
IF(MAX('Table'[ingestion_ts])<>b,BLANK(),b)

 

 

 

  1. Create a measure using FORMAT function,
Measure 2 =
var t = FORMAT(MAX('Table'[ingestion_ts]),"YYYYMMDD")
var t2 = CALCULATE(MAX('Table'[ingestion_ts]),ALLSELECTED('Table'),FORMAT('Table'[ingestion_ts],"YYYYMMDD")=t)
return
IF(
t2=MAX('Table'[ingestion_ts]),t2,BLANK())
 

35.png

 

BTW, pbix as attached.


Best regards,

 

 

Community Support Team _ Dong Li
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

3 REPLIES 3
v-lid-msft
Community Support
Community Support

Hi @topazz11 ,

 

How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?


Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @topazz11 ,

 

We can use two ways to meet your requirement.

 

  1. Create a measure using DATE function,
Measure =
VAR a =
    DATE ( YEAR ( MAX( 'Table'[ingestion_ts] ) ), MONTH ( MAX ( 'Table'[ingestion_ts] ) ), DAY ( MAX ( 'Table'[ingestion_ts] ) ) )
VAR b =
    CALCULATE (
        MAX ( 'Table'[ingestion_ts] ),
        FILTER (
            ALLSELECTED('Table'),
            DATE ( YEAR (  'Table'[ingestion_ts]  ), MONTH (  'Table'[ingestion_ts]  ), DAY ( 'Table'[ingestion_ts]  ) ) = a
        )
    )
RETURN
IF(MAX('Table'[ingestion_ts])<>b,BLANK(),b)

 

 

 

  1. Create a measure using FORMAT function,
Measure 2 =
var t = FORMAT(MAX('Table'[ingestion_ts]),"YYYYMMDD")
var t2 = CALCULATE(MAX('Table'[ingestion_ts]),ALLSELECTED('Table'),FORMAT('Table'[ingestion_ts],"YYYYMMDD")=t)
return
IF(
t2=MAX('Table'[ingestion_ts]),t2,BLANK())
 

35.png

 

BTW, pbix as attached.


Best regards,

 

 

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

Hi @topazz11 ,

 

You can try removing the ".[Date]", so you code will look like:

MAXX('Table'; 'Table'[Date])
 
I think using the ".[Date]", you are telling DAX to just get the date part, kind of convertion.
 
Ricardo


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

Proud to be a Super User!



Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors