2

I have a dataset in Power BI like this

ID    DATE 
1  06/24/2016
1  06/24/2017
1  06/24/2018
2  08/08/2017
2  08/08/2016
3  12/12/2015

I would like to create a calculated column with DAX, in which i have to calculate the latest date for every index, but I am only able to get the latest date of all the dataset or the same date for every row. The output should be this:

ID    DATE      MAXDATE
1  06/24/2016  06/24/2018
1  06/24/2017  06/24/2018
1  06/24/2018  06/24/2018
2  08/08/2017  08/08/2017
2  08/08/2016  08/08/2017
3  12/12/2015  12/12/2015
2
  • I guess there is a typo in your MAXDATE for your second line of ID=2 Jun 18, 2018 at 14:19
  • @Christoffer yup, I've corrected it.
    – aipam
    Jun 18, 2018 at 14:42

1 Answer 1

1
MAXDATE = CALCULATE(MAX(Table1[Date]);FILTER(Table1;Table1[ID]=EARLIER(Table1[ID])))
2
  • Gives a syntax error. Should be , instead of ; MAXDATE = CALCULATE(MAX(Table1[Date]),FILTER(Table1,Table1[ID]=EARLIER(Table1[ID])))
    – evoandy
    Sep 5, 2018 at 13:40
  • Depends on your region settings in Windows. Sep 6, 2018 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.