Forum Discussion
Customer Count by Active Years
- 3 years ago
Hi PBIX_COACH
You can use the matrix total column to present the Total Active Years (You can simply rename it). You need to replace the current measure (Measure1) with the followingMeasure2 = IF ( ISINSCOPE ( 'Date'[Year] ), [Measure1], COUNTX ( VALUES ( 'Date'[Year] ), [Measure1] ) )
Hi PBIX_COACH
You can use the matrix total column to present the Total Active Years (You can simply rename it). You need to replace the current measure (Measure1) with the following
Measure2 =
IF (
ISINSCOPE ( 'Date'[Year] ),
[Measure1],
COUNTX ( VALUES ( 'Date'[Year] ), [Measure1] )
)- PBIX_COACH3 years ago
Helper II
thanks for the assist tamerj1 but it's returning the total count for all companies by the year but I'm looking for the unique count of years. for example, company A has an activity for 3 years because it has data in 2019, 2020 and 2022 so it should return a total of 3 years active.
- PBIX_COACH3 years ago
Helper II
tamerj1 on another note how can I flag if there was a "win back" for example company A had a gap year in 2021 but returned in 2022?
- tamerj13 years ago
Community Champion
PBIX_COACH
Please tryMeasure2 = IF ( ISINSCOPE ( 'Date'[Year] ), [Measure1], VAR T1 = ADDCOLUMNS ( VALUES ( 'Date'[Year] ), "@Value", [Measure1] ) VAR T2 = FILTER ( T1, [@Value] <> BLANK () ) RETURN "Total Active Years: " & COUNTROWS ( T2 ) & UNICHAR ( 10 ) & "Win Back Years: " & SUMX ( T2, INT ( ISEMPTY ( FILTER ( T2, [Year] = EARLIER ( [Year] ) - 1 ) ) ) ) )