Forum Discussion
Last transaction dynamically
- 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.
Hi Anonymous ,
I didn't quite understand the result expected example part. From the problem description I understand you want to show :
In case all dates are selected
| ID | Date (DD/MM/YYYY) | Type |
| 1 | 08/12/2020 | B |
In calse 01/01/2020 to 30/11/2020 is selected
| ID | Date (DD/MM/YYYY) | Type |
| 2 | 12/11/2020 | A |
is that correct?
- Anonymous5 years agoNot applicable
I want to know the count of each type for the lastest transaction of a certain period of time, the period will be a slicer, so it needs to be dynamic.
In case all date are selected the lastest transaction for each ID are the ones that you said.