March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello ,
Can you please let me know calcualting below dax function :
Account Retention : # of active customers that have ramaning active every month ,over the last 12 months .
New coustomer : # of custmers that have not purchase ovet the prevoius 90 days
active account : # of customers that purchased on the last month
Datasource: using one fact table with order date and Date dim table
Solved! Go to Solution.
Try to create measures like below:
Account Retention =
var active_month=
CALCULATE(
COUNT(Sheet3[Customer]),
FILTER(
ALLEXCEPT(Sheet3,Sheet3[date].[Year],Sheet3[date].[Month],Sheet3[Customer]),
Sheet3[date]>=EDATE(TODAY(),-12)
)
)
return CALCULATE(
DISTINCTCOUNT(Sheet3[Customer]),FILTER(Sheet3,active_month=12))
New Customer Date =
CALCULATE (
MIN ( Sheet3[date]),
ALLEXCEPT (
Sheet3,
Sheet3[Customer]
)
)
New Customers =
VAR CustomersWithNewDate =
CALCULATETABLE (
ADDCOLUMNS (
VALUES ( Sheet3[Customer] ),
"NewCustomerDate",[New Customer Date]
),
ALLEXCEPT ( Sheet3, Sheet3[Customer] )
)
VAR NewCustomers =
FILTER (
CustomersWithNewDate,
[NewCustomerDate]
IN CALENDAR(TODAY()-180,TODAY())
)
VAR Result =
COUNTROWS ( NewCustomers )
RETURN
Result
active account = CALCULATE(DISTINCTCOUNT(Sheet3[Customer]),FILTER(Sheet3,Sheet3[date]>=EDATE(TODAY(),-1)))
Try to create measures like below:
Account Retention =
var active_month=
CALCULATE(
COUNT(Sheet3[Customer]),
FILTER(
ALLEXCEPT(Sheet3,Sheet3[date].[Year],Sheet3[date].[Month],Sheet3[Customer]),
Sheet3[date]>=EDATE(TODAY(),-12)
)
)
return CALCULATE(
DISTINCTCOUNT(Sheet3[Customer]),FILTER(Sheet3,active_month=12))
New Customer Date =
CALCULATE (
MIN ( Sheet3[date]),
ALLEXCEPT (
Sheet3,
Sheet3[Customer]
)
)
New Customers =
VAR CustomersWithNewDate =
CALCULATETABLE (
ADDCOLUMNS (
VALUES ( Sheet3[Customer] ),
"NewCustomerDate",[New Customer Date]
),
ALLEXCEPT ( Sheet3, Sheet3[Customer] )
)
VAR NewCustomers =
FILTER (
CustomersWithNewDate,
[NewCustomerDate]
IN CALENDAR(TODAY()-180,TODAY())
)
VAR Result =
COUNTROWS ( NewCustomers )
RETURN
Result
active account = CALCULATE(DISTINCTCOUNT(Sheet3[Customer]),FILTER(Sheet3,Sheet3[date]>=EDATE(TODAY(),-1)))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
6 | |
3 | |
3 | |
2 | |
2 |