Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

weighted average

Hi community,
I need calculate a weighted average and i have this condition:


Weight:

Weight = SUMX('Table',
IF([category]="XPTO1" &&
MONTH('Table'[Date]) = MONTH(IF(DISTINCTCOUNT('Table'[Date])>1, NOW(),[Date])) &&
YEAR'Table'[Date]) = YEAR(IF(DISTINCTCOUNT('Table'[Date])>1, NOW(),[Date]))
,[total])
)

Value:

value= Weight = SUMX('Table',
IF([category]="XPTO2" &&
MONTH('Table'[Date]) = MONTH(IF(DISTINCTCOUNT('Table'[Date])>1, NOW(),[Date])) &&
YEAR'Table'[Date]) = YEAR(IF(DISTINCTCOUNT('Table'[Date])>1, NOW(),[Date]))
,[total])
)

 


Can help me?

1 Reply

  • Anonymous , Not very clear. Both formulae seems the same. You can make one of them as count and divide