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...
v-lili6-msft
6 years agoCommunity Support
hi Anonymous
If so just adjust the formula as below:
Measure 2 =
var Initialdate= CALCULATE(MIN('Calendar'[Date]),ALLSELECTED('Calendar') )
var InitialSKU=CALCULATE(MAX('Table'[SKU]),FILTER('Table','Table'[Date]= Initialdate )) return
DIVIDE(CALCULATE(SUM('Table'[customer/outlet]),FILTER(ALLEXCEPT('Table','Table'[SKU]),'Table'[Date]<Initialdate)),CALCULATE(SUM('Table'[customer/outlet])))
Result:
Regards,
Lin
Anonymous
6 years agoNot applicable
Hi v-lili6-msft ,
In my case i have SKU column in product table and oderdate in sales table and calender date in a calender table.
I am writing measure as follows but it is not working. could you please modify the dax.
Measure = var Initialdate = CALCULATE(MIN('Calendar'[Date]),ALLSELECTED('Calendar'[Date])) return DIVIDE(CALCULATE(SUM(Sales[dw_cust_id]),ALLEXCEPT('Product','Product'[SKU_Name]),FILTER(Sales,Sales[Order_Date]<Initialdate)),CALCULATE(SUM(Sales[dw_cust_id])))
Thanks