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
PaulPalkowski
Helper II
Helper II

Looking for Last Value for each

I have this near complete...

What would I use to get the "last value", or the value with the most recent date/time 

Each site has about 60,000 records

 

Do you need more info to help me on this?

 

PaulPalkowski_0-1602781156590.png

 

10 REPLIES 10
V-lianl-msft
Community Support
Community Support

Hi @PaulPalkowski ,

 

Try to create a measure or column:

mostRecentDate = CALCULATE(MAX(table[LastDate]),ALLEXCEPT(table,table[Site])) 

 

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

I have the last date... I need the VALUE from that last date..

I have Min Value, Max Value, Avg Value for each, just need a new column for the LAST value 

image.png

 

here is what my data looks like

PaulPalkowski_0-1603203396318.png

Looking for value of last date for each SITE and AREA

Hi @PaulPalkowski ,

 

Try:

Measure = CALCULATE(LASTNONBLANK('Table'[VALUE],0),ALLEXCEPT('Table','Table'[SITE],'Table'[AREA]))

Column = CALCULATE(LASTNONBLANK('Table'[VALUE],0),ALLEXCEPT('Table','Table'[SITE],'Table'[AREA]))

V-lianl-msft_0-1603358929939.png

 

 

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

It gives me a value but not the most recent

Pragati11
Super User
Super User

Hi @PaulPalkowski ,

 

On what basis you need the last value?

Is it just date or along with date any categorical column in your data?

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

The last value for the last date for each Site/Area

Hi @PaulPalkowski ,

 

You can create a column as follows:

 

Is most recent =
var thisSite = tablename[Site]
var thisArea = tablename[Area]
var mostRecentDate = CALCULATE(MAX(tablename[Date]),FILTER(ALL(tablename), tablename[Site] = thisSite && tablename[Area] = thisArea))
return
IF(tablename[Date] = mostRecentDate,"yes","no")

 

The above DAX will return a column with YES/NO value based on most recent record at Site and Area level. Move this column to your table visual and select "yes". This will just display recent record in the table for a combination of Site and Area.

 

You can modify the above code as just SITE level or AREA level also.

 

Replace the right table name and column name in the above dax provided.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Since I cannot see how this can be done in the same table

Is it possible to create a new table from the original table with the value for the last known date of each Site and Area

16 rows and then create a measure to do a lookup back to my table or matrix visual?

 

I dont want the last record, I want the value of the last record and display that with my current table

I have a column of values....So I am looking to replace TBD with the value from the last date for each site

 

PaulPalkowski_2-1602853585850.png

 

 

 

 

 

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.