Forum Discussion
Need help with Measure (Average, Summarize)
- 4 years ago
Hi danandr87 ,
Try to create a measure like below:
Measure 2 = var total = CALCULATE([Measure],FILTER(ALL('Table'),'Table'[Period]="X")) var count_x =CALCULATE(DISTINCTCOUNT('Table'[YYMM]),FILTER(ALL('Table'),NOT(ISBLANK([Measure]))&&'Table'[Period]="X")) return DIVIDE(total,count_x,0)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi tamerj1,
thanks for your answer, but this does not meet my requirements.
I tried to explane my requirement in the following screenshot. I need the measure described with the red lines and frames. Your supposed measure got me the result in the green frame.
danandr87
Sorry I misunderstood your requirement.
Try
NEW MEASURE =
AVERAGEX (
ALL ( DateTable[YYMM] ),
CALCULATE ( SUM ( FactTable[QTY] ), FactTable[Type] = "GI" )
)Still I did not understand the purpose of the DateTable[Period] column. As it looks you did not include with your calculation. You can upload a file with sample insensitive data to WeTransfer for example and share the download link. This way will be able to provide you with much more reliable support.
Thank you!