Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hi everyone,
I have an issue on DAX that I can't solve, maybe someone could help.
Here is my example
My problem: I would like to count the number of new customers who bought in April ONLY and not during previous months.
In our case, 2 new customers (customer C & D)
Let's imagine a purchase teble like below:
Customer | Month of purchase |
A | 1 |
A | 2 |
A | 4 |
B | 1 |
B | 3 |
C | 4 |
C | 4 |
D | 4 |
Solved! Go to Solution.
Apr ONLY =
CONCATENATEX(
FILTER(
CALCULATETABLE( VALUES( SALES[Customer] ), SALES[Month of purchase] = 4 ),
CALCULATE( ISEMPTY( SALES ), SALES[Month of purchase] <> 4 )
),
SALES[Customer],
", "
)
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LeanAndPractise(Everyday) ) |
Apr ONLY =
CONCATENATEX(
FILTER(
CALCULATETABLE( VALUES( SALES[Customer] ), SALES[Month of purchase] = 4 ),
CALCULATE( ISEMPTY( SALES ), SALES[Month of purchase] <> 4 )
),
SALES[Customer],
", "
)
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LeanAndPractise(Everyday) ) |
Please try the following,
Count of People =
var _OtherCustomers =
CALCULATETABLE(
VALUES('Table'[Customer]),
'Table'[Month of purchase] < 4
)
var _Result =
COUNTROWS(
SUMMARIZE(
FILTER(
'Table',
'Table'[Month of purchase] = 4
&&
NOT('Table'[Customer] in _OtherCustomers)
),
'Table'[Customer]
)
)
return _Result
The idea is to,
User | Count |
---|---|
15 | |
10 | |
9 | |
9 | |
8 |