Forum Discussion
Show only data from the latest date
- 8 years ago
Hi ChristianTD,
Seems date type values don't have a "TOP" filter type. I would suggest you try the measure below and add it to the "Visual Level filter". Don't need to add it to any visual. Then filter the filter as "1". Please give it a try.
Measure = VAR LatestDate = CALCULATE ( MAX ( 'Table1'[Date] ), ALL ( 'table1' ) ) RETURN IF ( MIN ( 'Table1'[Date] ) = LatestDate, 1, 0 )Best Regards,
Dale
In the original example, this solution would provide the most recent entries in the table (although I get 0 for all entries). However, I'm wondering how I could have it get just the most recent entries per group, as my dates are not necessarily like above.
For example
SN Date
123 2018-10-23
123 2019-03-14
123 2022-12-03
456 2019-12-25
456 2020-01-01
456 2022-05-15
789 2022-01-31
789 2023-09-28
Should return:
SN Date
123 2022-12-03
456 2022-05-15
789 2023-09-28
- Ashish_Mathur2 years ago
Super User
Hi,
This M code works
let Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content], #"Changed Type" = Table.TransformColumnTypes(Source,{{"SN", Int64.Type}, {"Date", type date}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"SN"}, {{"Count", each List.Max([Date]), type nullable date}}) in #"Grouped Rows"Hope this helps.