Forum Discussion
Unique Clients per Quarter
- 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
Yeah, you're right, doesn't make sense. Is there a way to incorporatethe year into the original code you shared, so it only counts IDs in the year selected in another slicer?
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