Forum Discussion
pfarahani
Helper II
5 years agoDAX measure for Max Date
Hello, I am creating a measure to get the max month and the max year that is in my data. So far I have a working measure that gets the latest month. Can I also add the Year to this? How can I ad...
- 5 years ago
I think I got it, check this one out:
Latest Date =VAR MaxOrder =MAX ( 'Dates TEST'[MonthNum] )VAR MaxYear =MAX('Dates TEST'[Year])RETURNCALCULATE ( MAX( 'Dates TEST'[Month] ), 'Dates TEST'[MonthNum] = MaxOrder ) & " " & MaxYear
selimovd
Most Valuable Professional
5 years agoHey pfarahani ,
your measure takes the MAX MonthNum. So if you want to get the MAX year, you have to do the same with the column that contains the year. Or with date and get the year out of that date.
But I don't know your data, so you either have to find our yourself or share some more information.
If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic
pfarahani
Helper II
5 years agoI think I got it, check this one out:
Latest Date =
VAR MaxOrder =
MAX ( 'Dates TEST'[MonthNum] )
VAR MaxYear =
MAX('Dates TEST'[Year])
RETURN
CALCULATE ( MAX( 'Dates TEST'[Month] ), 'Dates TEST'[MonthNum] = MaxOrder ) & " " & MaxYear