Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Truelearner
Helper III
Helper III

need help with dax to create table with most recent dates

I have a table like below 

datevalue
12-01-20201
18-03-20202
24-03-20203

 

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 

datevalue
12-01-20201
24-03-20203

@mgwena @cham @amitchandak @Greg_Deckler @Mariusz 

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
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] ) )
)

2.PNG

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xuding-msft
Community Support
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] ) )
)

2.PNG

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
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]
  )

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks for taking time , its not working 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.