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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.