2
votes

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
1
I guess there is a typo in your MAXDATE for your second line of ID=2Christoffer
@Christoffer yup, I've corrected it.aipam

1 Answers

1
votes
MAXDATE = CALCULATE(MAX(Table1[Date]);FILTER(Table1;Table1[ID]=EARLIER(Table1[ID])))