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

View all the Fabric Data Days sessions on demand. View schedule

Reply
PowerUser123
Helper II
Helper II

Get Value associated with Max Date Per Group

So my data would be structured as such:

 

PowerUser123_0-1649760511520.png

I need to get the value associated per user based on the Max date.

 

So the result for User 1 would be 14 and the result for User 2 would be 2.

 

Ideally I would want this as a calculated column or in query editor

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @PowerUser123 

 

You can try the following methods.

Column:

Max = 
IF (
    [Date]
        = CALCULATE (
            MAX ( 'Table'[Date] ),
            FILTER ( 'Table', [User] = EARLIER ( 'Table'[User] ) )
        ),
    [Value]
)
Max 2 = 
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER (
        'Table',
        [Date]
            = CALCULATE (
                MAX ( 'Table'[Date] ),
                FILTER ( 'Table', [User] = EARLIER ( 'Table'[User] ) )
            )
            && [User] = EARLIER ( 'Table'[User] )
    )
)

vzhangti_0-1650201848889.png

These are the methods to find the maximum date correlation value.

 

Best Regards,

Community Support Team _Charlotte

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

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @PowerUser123 

 

You can try the following methods.

Column:

Max = 
IF (
    [Date]
        = CALCULATE (
            MAX ( 'Table'[Date] ),
            FILTER ( 'Table', [User] = EARLIER ( 'Table'[User] ) )
        ),
    [Value]
)
Max 2 = 
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER (
        'Table',
        [Date]
            = CALCULATE (
                MAX ( 'Table'[Date] ),
                FILTER ( 'Table', [User] = EARLIER ( 'Table'[User] ) )
            )
            && [User] = EARLIER ( 'Table'[User] )
    )
)

vzhangti_0-1650201848889.png

These are the methods to find the maximum date correlation value.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Tahreem24
Super User
Super User

@PowerUser123 Create this measure:

Measure  =
VAR MaxDate_ = CALCULATE(MAX(UserTable[Date]),ALLEXCEPT(UserTable,UserTable[User]))
RETURN CALCULATE(SUM(UserTable[Value]),UserTable[Date]=MaxDate_)

Capture.JPG
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors