Forum Discussion
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?
10 Replies
- Pragati11
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?
- PaulPalkowski
Helper II
The last value for the last date for each Site/Area
- Pragati11
Super User
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
- V-lianl-msft
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.- PaulPalkowski
Helper II
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
- PaulPalkowski
Helper II
here is what my data looks like
Looking for value of last date for each SITE and AREA