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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
sdgiss
Helper I
Helper I

DAX to find specific date of max record

I have another question concerning the same dataset as in my post two days ago. I found the all-time max speed of the racers with the following DAX formula (big thanks to the MS Power Bi community!). I am able to report each unique max value in my daiiy report with a date filter.

 

Max Sp-ALL-TIME :=
IF (
    [Max Sp-DAILY],
    CALCULATE (
        MAX ( fData[Max Speed] ),
        FILTER ( ALL ( dDate ), dDate[Date] )
    )
)

 

I am now trying to report (daily) the date of each individual all-time max (with a date filter). The following solution was found inside the comments section of a Power Pivot Pro blog post written by Reid Havens. Without a date filter the output is perfection. Unfortunately when reporting values for a specific date the solution falls apart for me.

 

Max Sp-MAX Date :=
IF (
    NOT ( ISBLANK ( [Max Sp-DAILY] ) ),
    MAXX (
        TOPN (
            1,
            ADDCOLUMNS ( VALUES ( dDate[Date] )"MAX SPEED DATE", [Max Sp-DAILY] ),
            [MAX SPEED DATE]
        ),
        dDate[Date]
    )
)

 

The output with a date filter is on the left, and without a date filter on the right.

Screen Shot 2020-10-27 at 9.14.28 PM.png

 

Thank you all in advance for the assistance!

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

@sdgiss try change VALUES ( dDate[Date] ) to ALL ( dDate[Date] )

View solution in original post

2 REPLIES 2
wdx223_Daniel
Super User
Super User

@sdgiss try change VALUES ( dDate[Date] ) to ALL ( dDate[Date] )

Thank youu @wdx223_Daniel! I should have used your reply from my previous post as a reference!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.