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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
yve214
Helper III
Helper III

Help with Recent date value

Hi there,

 

I am trying to get the recent date value for the table below. 

 

I have tried the max and lastdate function but I cant seem to get the results i am expecting. 

I was able to get a seperate latest effective date column with Measure = Calculate(MAX(Table(Effective_Date), Allexcept(Table, table(id))

 

Table:

IDEmp_IDIntervalEffective_DateScore
11001001/01/20203.1

2

1001008/26/20203.3
31001311/20/20203.5
41001505/05/20203.2
5100152/1/20214.1
6100201/1/20222.0

 

Expected result if i want to see the recent date values if i filter by interval 0.

 

IDEmp_IDEffective_DateScore
210018/26/2020

3.3

610021/1/20222.0

or if i dont filter any of the intervals i should get all client IDs with a recent date value witht their corresponding intervals.

 

IDEmp_IDIntervalEffective_DateScore
2100108/26/2020

3.3

6100201/1/20222.0
31001311/20/20203.5
5100152/1/20214.1

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @yve214 ,

 

According to your description, refer to the following formula.

Score Measure =
VAR data_recent =
    CALCULATE (
        MAX ( 'Table'[Effective_Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Emp_ID] = MAX ( 'Table'[Emp_ID] )
                && 'Table'[Interval] = 0
        )
    )
RETURN
    CALCULATE (
        MAX ( 'Table'[Score] ),
        ALL ( 'Table' ),
        'Table'[Emp_ID] = MAX ( 'Table'[Emp_ID] )
            && 'Table'[Effective_Date] = data_recent
    )

vhenrykmstf_0-1643877776860.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your feedback.


Best Regards,
Henry


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-henryk-mstf
Community Support
Community Support

Hi @yve214 ,

 

According to your description, refer to the following formula.

Score Measure =
VAR data_recent =
    CALCULATE (
        MAX ( 'Table'[Effective_Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Emp_ID] = MAX ( 'Table'[Emp_ID] )
                && 'Table'[Interval] = 0
        )
    )
RETURN
    CALCULATE (
        MAX ( 'Table'[Score] ),
        ALL ( 'Table' ),
        'Table'[Emp_ID] = MAX ( 'Table'[Emp_ID] )
            && 'Table'[Effective_Date] = data_recent
    )

vhenrykmstf_0-1643877776860.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your feedback.


Best Regards,
Henry


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

amitchandak
Super User
Super User

@yve214 , use this measure for score ,

Score Measure =
VAR __id = MAX ('Table'[Emp_ID] )
VAR __date = CALCULATE ( MAX('Table'[Effective_Date] ), ALLSELECTED ('Table' ), 'Table'[Emp_ID] = __id )
CALCULATE ( MAX ('Table'[Score] ), VALUES ('Table'[Emp_ID] ),'Table'[Emp_ID] = __id,'Table'[Effective_Date] = __date )

 

 

if needed use max for Effective_Date

 

of try a measure like

calculate(lastnonblankvalues( 'Table'[Effective_Date], MAX ('Table'[Score] ) ))

 

or

 

calculate(lastnonblankvalues( 'Table'[Effective_Date], MAX ('Table'[Score] ) ), filter ( allselected(Table) , Table[Emp_ID] = max(Table[Emp_ID]) && Table[Interval] = max(Table[Interval]) ) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.