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.
Hi Everyone,
I have some difficulties find it the right measure for my new customer metrics :
I have 3 tables in my model :
1 - Orders
2 - Customers
3- Calendar ( date table)
I want to create a table that shows all new customers per month and year so i used the following measure :
Solved! Go to Solution.
Hi @Anonymous
Please use Orders[ID] instead of Customers[ID]
New Customers =
COUNTROWS (
FILTER (
ADDCOLUMNS (
VALUES ( Orders[ID] ),
"PreviousSales",
CALCULATE (
COUNTROWS ( Orders),
FILTER (
ALL ( 'Calendar' ),
'Calendar'[Date] < MIN ( 'Calendar'[Date] )
)
)
),
ISBLANK ( [PreviousSales] )
)
)
Or you could try other methods
https://finance-bi.com/power-bi-new-and-repeat-customers/
https://www.sqlbi.com/articles/computing-new-customers-in-dax/
Best Regards
Maggie
Hi @Anonymous
Please use Orders[ID] instead of Customers[ID]
New Customers =
COUNTROWS (
FILTER (
ADDCOLUMNS (
VALUES ( Orders[ID] ),
"PreviousSales",
CALCULATE (
COUNTROWS ( Orders),
FILTER (
ALL ( 'Calendar' ),
'Calendar'[Date] < MIN ( 'Calendar'[Date] )
)
)
),
ISBLANK ( [PreviousSales] )
)
)
Or you could try other methods
https://finance-bi.com/power-bi-new-and-repeat-customers/
https://www.sqlbi.com/articles/computing-new-customers-in-dax/
Best Regards
Maggie
Thanks Juanli it's seems to work !! thank you !!
@Anonymous , try like
New Customers =
var _min = MINX (allselected('Calendar'), 'Calendar'[Date] )
return
countx (
FILTER ( summarize (Customers[ID],"PreviousSales",CALCULATE (COUNTROWS ( Orders),FILTER (ALL ( 'Calendar' ),'Calendar'[Date] < _min))
, "_this",COUNTROWS ( Orders)),ISBLANK ( [PreviousSales] ) ) )
unless this month data is not in context it will not give customer
@ amitchandak Thank you for your reply !
The measure is not working, it doesnt recognize Customer ID in the formulas....
Cheers
Ilhame
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 |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
145 | |
108 | |
107 | |
89 | |
61 |