Forum Discussion
cyberblitz
Helper II
6 years agoFind last value by date
I am struggling to solve this. I have searched and tried numerous formulas to no avail. The dataset is thus(sorry about the formatting): District Facility Shift Rooms ModifiedAt ...
- 6 years ago
Hi cyberblitz ,
Based on your sample, I got the following result. Is it your expected output?
Here are two measures I used.
Max Date = CALCULATE ( MAX ( 'Table'[ModifiedAt] ), ALLEXCEPT ( 'Table', 'Table'[Facility] ) )Value = CALCULATE ( MAX ( 'Table'[Beds] ), FILTER ( 'Table', 'Table'[ModifiedAt] = [Max Date] ) )
cyberblitz
Helper II
6 years agov-eachen-msft
Community Support
6 years agoHi cyberblitz ,
Based on your sample, I got the following result. Is it your expected output?
Here are two measures I used.
Max Date =
CALCULATE (
MAX ( 'Table'[ModifiedAt] ),
ALLEXCEPT ( 'Table', 'Table'[Facility] )
)Value =
CALCULATE (
MAX ( 'Table'[Beds] ),
FILTER ( 'Table', 'Table'[ModifiedAt] = [Max Date] )
)
- cyberblitz6 years ago
Helper II
No, sorry.
The result should look exactly like:
FACILITY MAX DATE VALUE
HOTEL1 12/06/2020 08:46:17 22
HOTEL2 12/06/2020 07:38:39 5
- v-eachen-msft6 years ago
Community Support
Hi cyberblitz ,
Sorry, I forgot to use a date type.
Here is the result:
The measures are the two measures above.
- cyberblitz6 years ago
Helper II
Yep, that's it. Many Thanks. I suppose it's similiar to the SQL script i created to produce the same result, where it refers upon itself..