Forum Discussion
Truelearner
Helper III
6 years agoneed help with dax to create table with most recent dates
I have a table like below
| date | value |
| 12-01-2020 | 1 |
| 18-03-2020 | 2 |
| 24-03-2020 | 3 |
I want to create the below table for my caluclations ,i would like to ignore all dates with in a month which have more than one date expect the one with highest date
| date | value |
| 12-01-2020 | 1 |
| 24-03-2020 | 3 |
Hi Truelearner ,
If you want to create a measure to implement it, you could try like this:
- Create a month column
Month = MONTH('Table'[date])- Create a measure
Measure = CALCULATE ( MAX ( 'Table'[value] ), FILTER ( ALL ( 'Table' ), 'Table'[Month] = MAX ( 'Table'[Month] ) ) )
3 Replies
- Greg_Deckler
Community Champion
Perhaps create a month year column like:
MonthYear = YEAR([date]) * 100 + MONTH([date])
Table = SELECTCOLUMNS( GROUPBY( 'Table', [MonthYear], "date",MAXX(CURRENTGROUP(),[date]) "value",[value] ) "date",[date], "value",[value] )- Truelearner
Helper III
Thanks for taking time , its not working
- v-xuding-msft
Community Support
Hi Truelearner ,
If you want to create a measure to implement it, you could try like this:
- Create a month column
Month = MONTH('Table'[date])- Create a measure
Measure = CALCULATE ( MAX ( 'Table'[value] ), FILTER ( ALL ( 'Table' ), 'Table'[Month] = MAX ( 'Table'[Month] ) ) )