Forum Discussion
Cannot use "does not equal" in Filter function?
Your last FILTER argument is attempting to do FILTER(Data, [Total Amount Due] <> 0) and then dividing by the SUM function. What exactly are you trying to do here? Is the division by SUM supposed to be happening to the result of the CALCULATE? If so, you need to adjust your parentheses.
This is what your expression is currently saying, formatted:
Weight =
VAR
IDS = Data[ID Number]
RETURN
CALCULATE(
SUMX(
Data,
Data[Days Old] * Data[Total Amount Due]
),
FILTER('Data', Data[ID Number] = IDS),
FILTER('Data', Data[Total Amount Due] <> 0) / SUM(Data[Days Old])
)
Did you mean to do something like this at the end?
FILTER('Data', Data[Total Amount Due] <> 0)
) / SUM(Data[Days Old])Thanks for the reply.
What I am trying to do is by row, multiply the Days Old column by the Total Amount Due column. Then divide this result by the sum of the entire Days Old column.
There is a column ID Number that should be unique per row, so this filter I guess is included to make sure it multiples only by each row (not sure if that is necessary).
And then finally I also now want to filter this calculation to not include any rows where the Total Amount Due column is zero. So if the Total Amount Due column is zero for a particular row, it should not multiply Days Old by Total Amount due and it should also not include this row in the sum of Days Old column which is what I am dividing by at the end.
Let me know if that doesn't make sense.
- v-chuncz-msft8 years agoCommunity Support
Anonymous,
If convenient, share us an example. Check if the following calculated column works.
Column = DIVIDE ( Data[Days Old] * Data[Total Amount Due], SUMX ( Data, Data[Days Old] * Data[Total Amount Due] ) )