Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am trying to calculate the total number of distinct new accounts. The logic I am wanting to use is the following:
- Sales > 0 in the last 30 days for each specific account
- Sales <= 0 in all days prior for each specific account
I am unable to wrap my head around how make this logic apply to each unique Account ID. Below is the measure i am currently using. This may be totally off track, but even if it is the correct direction I am still missing the account logic within each VAR.
For reference:
[Quantity 9 L] = Sales
[CleansedOutletKey] = Unique Account ID
New Account =
Var Sales_30_Days = sumx(
Filter('VIPReport Depletion Detail',
RELATED('report Date'[Relative Day]) <= 30
)
,
'VIPReport Depletion Detail'[Quantity 9 L])
Var Sales_30_Days_Prior = sumx(
Filter('VIPReport Depletion Detail',
RELATED('report Date'[Relative Day]) > 30
)
,
'VIPReport Depletion Detail'[Quantity 9 L])
return if(and(
Sales_30_Days > 0,
Sales_30_Days_Prior <= 0
)
,
DISTINCTCOUNT('VIPReport Depletion Detail'[CleansedOutletKey]),
0
)
Hi @dblain,
If you need more help, please provide a sample.
Best Regards,
Dale
Hey,
without more information about your data model, it's difficult to provide guidance just by looking at your DAX statement.
Maybe you are not aware of this blog post by Chris Webb about Returning Customer, but it also provides insight how to create a DAX statement that counts new customer:
https://blog.crossjoin.co.uk/2010/05/03/counting-returning-customers-in-dax/
Regards
Tom
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |