Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
I have a simple dataset with CustomerID, FY, and SalesValue. If a client didn't buy anything in a certain year, there is no row. So some clients have 1 row (e.g. only 2019) and some clients have 4 rows (e.g. 2018-2022).
I would like to find out how many clients bought something in ONLY a certain year, for example only in 2021.
And then how many clients bought something only in 2021&2022, but no other years.
I managed to do the second bit:
If you set up a slicer to choose which financial years you want to see, you could try
# customers in FY =
VAR selectedYears =
VALUES ( 'Revenue'[FY] )
RETURN
SUMX (
VALUES ( 'Revenue'[Customer ID] ),
VAR boughtYears =
CALCULATETABLE (
VALUES ( 'Revenue'[FY] ),
ALLEXCEPT ( 'Revenue', 'Revenue'[Customer ID] )
)
RETURN
IF ( ISEMPTY ( EXCEPT ( boughtYears, selectedYears ) ), 1 )
)
Thank you.
This does something, but the value it returns is much too low, I am not sure why.
What if I wanted only 2 callout values: one for customers that only bought in 2020 and one for customers that only bought in 2021? How would I create those 2 measures? Here's what I've tried but it's wrong:
20 =
CALCULATE (
DISTINCTCOUNT( 'Revenue'[CustomerID] ),
FILTER (
VALUES ( 'Revenue'[CustomerID] ),
CALCULATE ( DISTINCTCOUNT ( 'Revenue'[FY] ) ) = 2021
&& CALCULATE ( MAX ( 'Revenue'[FY] ) ) = 1
)
)
User | Count |
---|---|
13 | |
12 | |
8 | |
8 | |
6 |
User | Count |
---|---|
28 | |
19 | |
13 | |
11 | |
7 |