Forum Discussion
Average last 3 Months with Distinct Value
- 5 years ago
Hi tracytran91,
Sorry for delay reply.
Try measure as:
Measure = var curr_month=SELECTEDVALUE('Table'[Month]) var temp= AVERAGEX( FILTER( ALLSELECTED('Table'[Month]), 'Table'[Month]<curr_month&&'Table'[Month]>=curr_month-3 ), DISTINCTCOUNT('Table'[Store Code])) return tempThe pbix is attached.
If you still have some question, please don't hesitate to let me known.
Best Regards,
Link
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!
Hi v-xulin-mstf , Please kindly have a look desired result.
Sample data here:
https://drive.google.com/file/d/1mQzTZ53zI_3EJ4okIpNJCmC9G-IXOxDF/view?usp=sharing
I would like to know:
At Channel DOMESTIC with stores with sales bigger than 0 ( It means excluding return), What is the average last 3 Months of DISTINCT STORE ordered our product?
Hi tracytran91,
Sorry for delay reply.
Try measure as:
Measure =
var curr_month=SELECTEDVALUE('Table'[Month])
var temp=
AVERAGEX(
FILTER(
ALLSELECTED('Table'[Month]),
'Table'[Month]<curr_month&&'Table'[Month]>=curr_month-3
),
DISTINCTCOUNT('Table'[Store Code]))
return temp
The pbix is attached.
If you still have some question, please don't hesitate to let me known.
Best Regards,
Link
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!