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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
ArchStanton
Impactful Individual
Impactful Individual

Latest Value Measure not Working

Hi

I have the following table located in an Excel Tab called 18mth+ Closed

ArchStanton_0-1741188779552.png

The latest value my measure is showing is 1109 which is 3 months ago!

ArchStanton_2-1741188949490.png


Why isn't the measure showing 1384 which is the Feb figure?

LatestValue18mths+ Closed = 
    VAR _lastdate = 
            CALCULATE(MAX('18mth+ Closed'[Date]),
            FILTER('18mth+ Closed','18mth+ Closed'[KPI] <> BLANK() )
            )
    RETURN
        CALCULATE(
                MAX('18mth+ Closed'[KPI]),
                FILTER ('18mth+ Closed', '18mth+ Closed'[Date] = _lastdate)
        )

 

Thanks

 

 

 

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

Hi @ArchStanton ,

 

1. Desktop --> home pane --> transform data --> transform data

vcgaomsft_1-1741227402452.png

2. Powerquery editor --> add column --> index column --> close and apply.

vcgaomsft_0-1741227371907.png

Modify the measure:

LatestValue18mths+ Closed = 
    VAR _lastindex = 
            CALCULATE(MAX('18mth+ Closed'[Index]),
            FILTER('18mth+ Closed','18mth+ Closed'[KPI] <> BLANK() )
            )
    RETURN
        CALCULATE(
                MAX('18mth+ Closed'[KPI]),
                FILTER ('18mth+ Closed', '18mth+ Closed'[Index] = _lastindex)
        )

and the output:

vcgaomsft_2-1741227556873.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

(Virus scan in progress ...)
3 REPLIES 3
v-cgao-msft
Community Support
Community Support

Hi @ArchStanton ,

 

1. Desktop --> home pane --> transform data --> transform data

vcgaomsft_1-1741227402452.png

2. Powerquery editor --> add column --> index column --> close and apply.

vcgaomsft_0-1741227371907.png

Modify the measure:

LatestValue18mths+ Closed = 
    VAR _lastindex = 
            CALCULATE(MAX('18mth+ Closed'[Index]),
            FILTER('18mth+ Closed','18mth+ Closed'[KPI] <> BLANK() )
            )
    RETURN
        CALCULATE(
                MAX('18mth+ Closed'[KPI]),
                FILTER ('18mth+ Closed', '18mth+ Closed'[Index] = _lastindex)
        )

and the output:

vcgaomsft_2-1741227556873.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

(Virus scan in progress ...)

Thank you, this works perfectly

Akash_Varuna
Solution Sage
Solution Sage

Hi @ArchStanton Try this 

LatestValue18mths+ Closed =
VAR _lastdate =
    CALCULATE(
        MAX('18mth+ Closed'[Date]),
        FILTER(
            '18mth+ Closed',
            NOT(ISBLANK('18mth+ Closed'[KPI]))
        )
    )
RETURN
    CALCULATE(
        MAX('18mth+ Closed'[KPI]),
        '18mth+ Closed'[Date] = _lastdate
    )

Screenshot 2025-03-05 220638.png
If this popst helped please do give a kudos and accept this as a solution
Thanks In Advance

Helpful resources

Announcements