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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Most Recent value - help

Hi all,

 

I have a sheet containing collated invoice requests.

 

Job number     Invoice Date     Invoice Value     Comments

1001                01/01/2020       £500                  ABC

1002                01/02/2020       £750                  DEF

1001                01/03/2020       £100                  GHI

1003                01/03/2020       £500                  JKL

1002                01/04/2020       £250                  MNO

1004                01/05/2020       £1000                PQR

 

Ultimately I need to get the following:

Most Recent Invoice Date

Value of Most Recent Invoice

Comments of Most Recent Invoice

 

I have the following Measures working:

MaxInvoiceDate = MAX(
Collated[Invoice Date]
)

 

MaxInvoiceComments =
LOOKUPVALUE (
Collated[Comments],
Collated[Invoice Date],
    [MaxInvoiceDate],
Collated[Job Number],
    MAX(Collated[Job Number]),
Collated[Comments],
    MAX ( Collated[Comments] )
)
 
What I'm having issues with, is determining the value of the most recent invoice.
Can anyone help?
 
 
1 ACCEPTED SOLUTION
ibarrau
Super User
Super User

Hi. You have to pick an aggregation because there will bemore than one date. First you need a calendar table related with that table. That way you can manage dates easily. You can build a measure like this

Sum of Last date = 
CALCULATE (
    SUM ( 'Table'[Invoice] ),
    LASTDATE ( 'Calendar'[Date] )
)

Hope that helps,


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

Happy to help!

LaDataWeb Blog

View solution in original post

2 REPLIES 2
ibarrau
Super User
Super User

Hi. You have to pick an aggregation because there will bemore than one date. First you need a calendar table related with that table. That way you can manage dates easily. You can build a measure like this

Sum of Last date = 
CALCULATE (
    SUM ( 'Table'[Invoice] ),
    LASTDATE ( 'Calendar'[Date] )
)

Hope that helps,


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

Happy to help!

LaDataWeb Blog

Anonymous
Not applicable

This seems to have worked! Thanks so much!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.