Forum Discussion
ronlolololo
Helper I
6 years agoMAXX Function Lookup
Hi folks, i am playing around the DAX and came across this issue. So the calculated column should return the case number of last day of the same county. It works fine for the first few rows but the s...
- 6 years ago
please try this
Column = VAR _date=MAXX(FILTER('Table','Table'[countryFIPS]=EARLIER('Table'[countryFIPS])&&'Table'[State]=EARLIER('Table'[State])&&'Table'[date]<EARLIER('Table'[date])),'Table'[date]) return MAXX(FILTER('Table','Table'[countryFIPS]=EARLIER('Table'[countryFIPS])&&'Table'[State]=EARLIER('Table'[State])&&'Table'[date]=_date),'Table'[cases])
v-kelly-msft
Community Support
6 years agoHi ronlolololo ,
It is because your date column is ranking ascending,so using your expression can get the result you need,but if your date column is disordering,then you will get a wrong return,such as your case number.
The best solution is to create an index column.
I made a simple sample,pls see attached.
Best Regards,
Kelly
Kelly
Did I answer your question? Mark my post as a solution!