Forum Discussion
Anonymous
4 years agoNot applicable
Getting previous date by category, not min date
Hello all, this Measure is working as long as there are only 2 dates Min and Max, but I need to get the date before Max regardless if it's Min or not. 1 table, 1 date column and 1 category column. I ...
- 4 years ago
Thanks for clearer explanation, below you can try the new measure for the different of the days compare to previous ID.
Measure =var forid = SELECTEDVALUE('Table'[ID])var selectdate = SELECTEDVALUE('Table'[Date])var previousdate = CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),'Table'[ID]=forid-1))var result = DATEDIFF(previousdate,selectdate,DAY)returnIF(previousdate=BLANK(),BLANK(),result)
Another measure is the status:Status =var forid = SELECTEDVALUE('Table'[ID])var forcategory = SELECTEDVALUE('Table'[Category])var result = CALCULATE(MAX('Table'[Category]),FILTER(ALL('Table'),'Table'[ID]=forid-1))returnIF(result=BLANK(), BLANK(), IF(forcategory<>result, "Change", "No Change"))Hope this can help you.
- 4 years ago
Hi Anonymous
If the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.
Looking forward to your feedback.
Best Regards,
Henry
Anonymous
4 years agoNot applicable
Thank you, I will try this on Tuesday when I return to work and let you know.
I really appreciate the help
v-henryk-mstf
Community Support
4 years agoHi Anonymous
If the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.
Looking forward to your feedback.
Best Regards,
Henry