Forum Discussion
Anonymous
7 years agoNot applicable
Simple measure
Hi, I want a measure that gives me the count of Client ID that have made a transaction in the last 3 months. My table looks like this: Client ID Operation Date 1 Last transaction 8/...
- Anonymous7 years ago
HI Anonymous ,
I'd like to suggest you to use date and today functions to looping records and get last three month distinct count based on current date:
Measure = CALCULATE ( COUNTROWS ( VALUES ( Table[Client ID] ) ), FILTER ( ALLSELECTED ( Table ), [Operation] = "Last transaction" && [Date] >= DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 3, DAY ( TODAY () ) ) && [Date] <= TODAY () ) )Regards,
Xiaoxin Sheng
Anonymous
7 years agoNot applicable
HI Anonymous ,
I'd like to suggest you to use date and today functions to looping records and get last three month distinct count based on current date:
Measure =
CALCULATE (
COUNTROWS ( VALUES ( Table[Client ID] ) ),
FILTER (
ALLSELECTED ( Table ),
[Operation] = "Last transaction"
&& [Date]
>= DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 3, DAY ( TODAY () ) )
&& [Date] <= TODAY ()
)
)
Regards,
Xiaoxin Sheng