Forum Discussion
russell80
3 years agoHelper III
Help Grouping and Summing Latest Records
helpI have a table with the following structure:
| Category | Colour | Date | Value | |
| Dog | Brown | 01/01/2023 | 1 | |
| Dog | Black | 02/01/2023 | 0 | |
| Dog | Yellow | 03/01/2023 | 0 | Sum this |
| Cat | White | 04/01/2023 | 1 | |
| Cat | Black | 05/01/2023 | 1 | |
| Cat | Ginger | 06/01/2023 | 0 | Sum this |
| Mouse | White | 07/01/2023 | 1 | |
| Mouse | Grey | 08/01/2023 | 0 | |
| Mouse | Black | 09/01/2023 | 1 | Sum this |
I'm trying to write a measure that sums the value column for the latest record of each Category. In this example the result would be 1. After much googling and chatgpt, I'm still stuck! Any help would be appreciated!
I also have a filter on the table visual that filters the date column, and I have a slicer that that slices the Colour column.
Hi russell80
Please tryResultMeasure = SUMX ( SUMMARIZE ( 'Table', 'Table'[Category], "@Value", SUMX ( TOPN ( 1, 'Table', 'Table'[Date] ), 'Table'[Value] ) ), [@Value] )