Forum Discussion
Anonymous
6 years agoNot applicable
Reorder dax calculation
Hi, slicer is between 1/1/2020 to 1/7/2020 i want to calculate initial value as customer count for a particular SKU between earilest date of calender date and up to day less than than the first dat...
Ashish_Mathur
Super User
6 years agoHi,
In 2019, for SKU A, there are only 3 customers - 1,2 and 4. From Jan 1-7 2020, for SKU A, of these 3 customers identified in the earlier period (1,2 and 4), there are only 2 customers - 1 and 2. So the answer should be 1+2+1 = 4 and not 1+2+1+3 = 7
Please check.
Anonymous
6 years agoNot applicable
Hi Ashish_Mathur Even as per the logic it should be 4..
Anonymoustry below measure,
ReorderValue =
var init=CALCULATE(SUM(Check[customer/outlet]),FILTER(Check,Check[Date]<MIN('Date'[Date])))
VAr Init_Outlet=DISTINCT(SELECTCOLUMNS(FILTER(check,Check[Date]<MIN('Date'[Date])),"Init",Check[customer/outlet]))
VAr Init_Sku=DISTINCT(SELECTCOLUMNS(FILTER(check,Check[Date]<MIN('Date'[Date])),"Init",Check[SKU]))
var final=
CALCULATE(SUM(Check[customer/outlet]),FILTER(Check,Check[Date]<=MAX('Date'[Date]) && Check[Date]>=MIN('Date'[Date]) && Check[customer/outlet] in Init_Outlet && Check[SKU] in Init_Sku))
return
DIVIDE(init,final,0)
For A it will return 11/4=2.8
for B 0
For C 4/3=1.3
Make sure your measure is of type decimal with 2 decimal seprations.
Else it will return 3,0,1
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.