Forum Discussion
Anonymous
5 years agoNot applicable
Last transaction dynamically
Hello! I'm trying to find the lastest transaction in a dynamic period, I have checked another posts in the forum but they doesnt work. I have tried everything and I can get them but the dynamic cal...
- 5 years ago
Hi Anonymous ,
Try the following formula:
Max_Date = CALCULATE( MAX('Table'[Date]), ALLSELECTED('Table'), GROUPBY('Table','Table'[ID]) )Measure = var result = CALCULATE( COUNT('Table'[ID]), FILTER( ALLSELECTED('Table'), 'Table'[Date] = [Max_Date] && 'Table'[Type] = MAX('Table'[Type]) ) ) return IF( HASONEFILTER('Table'[Type]), result, DISTINCTCOUNT('Table'[ID]) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
5 years agoSuper User
Anonymous , Try a measure like
Status =
VAR __id = MAX ('Table'[ID] )
VAR __date = CALCULATE ( MAX('Table'[Date] ), ALLSELECTED ('Table' ), 'Table'[ID] = __id )
CALCULATE ( count('Table'[Status] ), VALUES ('Table'[ID] ),'Table'[ID] = __id,'Table'[Date] = __date )
Anonymous
5 years agoNot applicable
Unfortunatelly, It doesnt seems to work, every type have value 1 with that measure.