Forum Discussion
kjmts5200
2 years agoFrequent Visitor
12 Month Running total with Filter
Hello. I have the DAX formula below, which calculates a 12-month running total of clients. However, I need this measure to filter only for active clients in the current month. For example, June shoul...
- Anonymous2 years ago
Hi kjmts5200 ,
Thanks for your reply. You can create a measure as below to get it:
Desired result = VAR _selmonth = SELECTEDVALUE ( 'Date'[Month] ) VAR _client1 = CALCULATETABLE ( VALUES ( 'Table'[Client ID] ), FILTER ( 'Table', 'Table'[Month] >= EOMONTH ( _selmonth, -13 ) + 1 && 'Table'[Month] <= _selmonth && 'Table'[Highest Tier Last 12 Months] = "1. High-Value" ) ) VAR _client2 = CALCULATETABLE ( VALUES ( 'Table'[Client ID] ), FILTER ( 'Table', 'Table'[Month] = _selmonth ) ) RETURN COUNTROWS ( INTERSECT ( _client1, _client2 ) )Best Regards
Anonymous
2 years agoNot applicable
Hi kjmts5200 ,
Thanks for your reply. You can create a measure as below to get it:
Desired result =
VAR _selmonth =
SELECTEDVALUE ( 'Date'[Month] )
VAR _client1 =
CALCULATETABLE (
VALUES ( 'Table'[Client ID] ),
FILTER (
'Table',
'Table'[Month]
>= EOMONTH ( _selmonth, -13 ) + 1
&& 'Table'[Month] <= _selmonth
&& 'Table'[Highest Tier Last 12 Months] = "1. High-Value"
)
)
VAR _client2 =
CALCULATETABLE (
VALUES ( 'Table'[Client ID] ),
FILTER ( 'Table', 'Table'[Month] = _selmonth )
)
RETURN
COUNTROWS ( INTERSECT ( _client1, _client2 ) )
Best Regards
kjmts5200
2 years agoFrequent Visitor
Thank you Anonymous!!!