reporting services - How to find the Average in a Calculated Member with filtered Values? -


i trying implement calculated member (ssrs or ssas ) show me average values per customer, need divide sum of values projects, , divide amount of projects don't have 0 value.

a similar table of values 1 using shown below.  

> customer   | project   |  value      | > customer1  | project1   | 124.24...  | > customer1  | project2   |     0.00   | > customer1  | project3   | 242.221... | > customer1  | project3   | 72.221...  | 

  tried in calculated member following (i tried in both ssrs , ssas)

sum([measures].[value]) /count(filter([order].[project], [measures].[value] > 0)) 

my hope filter out amount of projects have value of zero, , divide sum of values amount of projects have value of <> 0.

the problem is, when browser so i try calculated member out count value of projects (relative ex. above) 1 instead of 3, , average value :

(124.24 + 0 + 242.221 + 72.221) / 1

as opposed

(124.24 + 0 + 242.221 + 72.221) / 3 

(not devide 4 because 1 project has value of 0, , that's 1 want exclude count make).

my question has been answered on msdn forums duane dicks, i'm gonna post below.

" think why getting 1 instead of 3 because filter looking @ member , should looking @ it's children.

something should it:

sum([measures].[value]) /count(filter([order].[project].level(0).children, [measures].[value] > 0)) 

" msdn: how find average in calculated member filtered values?


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -