Forum Discussion
pbrainard
Helper III
4 years agoUnique Clients per Quarter
I have a table of clients seen, broken down by quarter. As you can see the Total is unique clients but the quarters reflect unique clients in those quarters. The numbers are a distinct count of clien...
- 4 years ago
You can use this code:
Count = VAR _PrevQuarter = CALCULATETABLE ( VALUES ( Table[ClientID] ), DATEADD ( 'Calendar Table'[Date], -1, QUARTER ) ) VAR _CurrentQuarter = VALUES ( Table[ClientID] ) RETURN IF ( ISINSCOPE ( 'Calendar Table'[Quarter] ), COUNTROWS ( EXCEPT ( _CurrentQuarter, _PrevQuarter ) ), DISTINCTCOUNT ( Table[ClientID] ) )This will provide the difference in quarters for the Quarter filter context (including the totals) and the total distincount per pooled cities on the row level and grand total. It might be worth providing an explanation to avoid false assumptions, or simply leave out the row totals altogether
PaulDBrown
Community Champion
4 years agoTry:
Count =
VAR _PrevQuarter =
CALCULATETABLE (
VALUES ( Table[ClientID] ),
DATEADD ( 'Calendar Table'[Date], -1, QUARTER )
)
VAR _CurrentQuarter =
VALUES ( Table[ClientID] )
RETURN
COUNTROWS ( EXCEPT ( _CurrentQuarter, _PrevQuarter ) )
pbrainard
Helper III
4 years agoLooks to be working great for the quarters. Thank you!!! How can I get the total to aggregate across the quarters?