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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Need to display the last record

We created a dashboard in Power BI Desktop to display the numeric values of various data points.  The data originates in SharePoint lists and is pulled into Power BI.  The issue is that there are multiple data values for each datapoint and to display the most recent data, we only want to show the last (most recent) data.  The figure below is an example the page in question.  It is a table visual that includes corresponding sparkline graphs.  Table visuals don’t provide an option for the last record. 

 

Charles_625g_0-1712235328000.png

 

 

We found two variants of a function for displaying the last record, but we are unable to get them to work (probably not getting the syntax right).

=Last(Fields!ProductNumber.Value, "Category")

= LAST(Products[Price], Products[Category])

 

The question is, how can we display only the last record for each line of data in the table shown above either using the function statements or some other method?

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,
According to your description, you want to get a VALUE value for a recent date.
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:

vheqmsft_0-1712305803363.png

Create a calculated column

 

Last Record = 
VAR _maxDate = MAXX(ALL('Table'),'Table'[Date])
RETURN
CALCULATE(
    MAX('Table'[Value]),
    FILTER(
        'Table',
        'Table'[Date] = _maxDate
        )
)

 

Final output

vheqmsft_1-1712305856132.png

 

Best regards,

Albert He

 

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

Anonymous
Not applicable

When I attempt to use this code in the table, I get the following error:

 

"A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed."

 

How can I eliminate the error?  The rest of the code seems to be correct as far as syntax.  

 

 

 

Anonymous
Not applicable

Hi @Anonymous ,
Thank you for your reply, based on the error message you provided, there is an issue with the way you are using true/false expressions in your DAX calculations.
I modified this dax a bit and you can try if it solves your problem

Rcord = 
VAR _date = MAX('Table'[Date])
RETURN
CALCULATE(
    MAX('Table'[Value]),
    FILTER(
        'Table',
        'Table'[Date] = _date
    )
)

Best regards,

Albert He

 

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

Anonymous
Not applicable

Thanks, this is helpful.  This code is more in line with other examples I have been finding.  Not familiar with the syntax so that is proving to be a challenge, but it gets us closer.  

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.