Forum Discussion
Average Daily sales problem
- 3 years ago
Hi deepguptaac ,
Please try:
Measure = VAR _a = SUMMARIZE ( 'Sales', [Date] ) VAR _b = ADDCOLUMNS ( _a, "NumberOfStore", CALCULATE ( DISTINCTCOUNT ( Sales[Store No_] ), FILTER ( _a, [Date] = EARLIER ( Sales[Date] ) ) ), "Sales", - CALCULATE ( SUM ( Sales[Net Amount] ), FILTER ( _a, [Date] = EARLIER ( Sales[Date] ) ) ) ) RETURN AVERAGEX ( _b, [Sales] / [NumberOfStore] )Output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
deepguptaac , Can share the current measure.
Assume you want Avg of sum above day level
Averagex(Values(Date[Date]), calculate(Sum(Sales[Value])) )
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
amitchandak Please find the link for sample data for your better understanding.
https://drive.google.com/file/d/1O-SLkkMSFLvmItREYRqGIBL_zu3BMMEN/view?usp=sharing
Here in the result in the total value for the selected period Average daily sales (ADS) should be 6716. However as total distinct store for that periods are 88 which is resulting in incorrect ADS. Store count should be average value for that period.
Thank you.