Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi All,
I have a Sales table in which date wise sales is given. The table has columns such as Customer Id, Customer name, Sales Date, Sales amount, Sales executive name. I need to make a measure in which i need to count no of customers who have not ordered in last 100 days.
Please help!!
Solved! Go to Solution.
@rohanjha1988 , Create a measure like this
Rolling 100 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],today(),-100,Day)) +0
or
Rolling 100 day =
var _max =maxx(allselected(Date), Date[Date])
return
CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],_max,-100,Day)) +0
like
Inactive customer = countX(filter(summarize(Customer,Customer[Customer ID],"_1",[Rolling 100 day]),[_1] >0),[Customer ID])
Rolling 100 day =0 means customer has no purchase in last 100 days
@rohanjha1988 , Create a measure like this
Rolling 100 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],today(),-100,Day)) +0
or
Rolling 100 day =
var _max =maxx(allselected(Date), Date[Date])
return
CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],_max,-100,Day)) +0
like
Inactive customer = countX(filter(summarize(Customer,Customer[Customer ID],"_1",[Rolling 100 day]),[_1] >0),[Customer ID])
Rolling 100 day =0 means customer has no purchase in last 100 days
please create a measure
_num = VAR tbl=CALCULATETABLE(VALUES('Table (3)'[customer]),FILTER('Table (3)','Table (3)'[orderdate]>=(today()-100)))
VAR tbl2=VALUES('Table (3)'[customer])
return COUNTROWS(tbl2)-COUNTROWS(tbl)
Proud to be a Super User!
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |