Forum Discussion
Help with calculated dates
ryan_mayu
Almost!
Now, the only thing that is still wrong is that we are calculating a difference in days for the start date of the process.
See below:
Since day 23/07/2019 is the first day of the process, we should not calculate the previous day.
I think it would be zero.
Measure =
var last=maxx(FILTER(all('Table'),'Table'[DT_atualizacao]<SELECTEDVALUE('Table'[DT_atualizacao])),'Table'[DT_atualizacao])
return if(ISFILTERED('Table'[DT_atualizacao]),if(ISBLANK(last),0,SELECTEDVALUE('Table'[DT_atualizacao])-MAXX(FILTER(all('Table'),'Table'[DT_atualizacao]=last),'Table'[DT_atualizacao])),CALCULATE(max('Table'[DT_atualizacao]),all('Table'))-CALCULATE(MIN('Table'[DT_atualizacao]),ALL('Table')))
In the DAX, iI checked if it is the earliest date, if it is , then display 0. please have a try.