6 Replies Latest reply on Sep 26, 2016 5:35 AM by Nader H

# How to count the occurrences of a dimension's value without excluding other values from view?

Hey guys,

Here's my table

I've been trying to count type = 2 without excluding the other types, also wanted to reflect count(type = 2) on all rows. (that's 80 for all rows)

I can tell that i got close but my knowledge in LOD is a bit limited.

Would appreciate the help!

• ###### 1. Re: How to count the occurrences of a dimension's value without excluding other values from view?

Does this work?

{FIXED [Customer Name]: SUM(IF [Type] = 2 THEN 1 END)}

1 of 1 people found this helpful
• ###### 2. Re: How to count the occurrences of a dimension's value without excluding other values from view?

Hey Andrew,

No it didn't work, honestly i suspect a bug as type = 2 works if i place it in filter but once i add it to columns or rows it counts all values.

Thanks for trying.

• ###### 3. Re: How to count the occurrences of a dimension's value without excluding other values from view?

Maybe this would help.

{ FIXED [Customer Name]: COUNT(if [Type] = 2 THEN 1 END) }

1 of 1 people found this helpful
• ###### 4. Re: How to count the occurrences of a dimension's value without excluding other values from view?

Hi ,

Check this once,

{ fixed : sum(if [type]=2 then 1 end) }

without using any dimension in expression.

• ###### 5. Re: How to count the occurrences of a dimension's value without excluding other values from view?

Do you have any filters on the workbook that we don't know about? FIXED works before standard filters are applied which could explain why you're seeing 96 instead of 80. If you do have some filters on the workbook please add them to context and see if it then works.

1 of 1 people found this helpful
• ###### 6. Re: How to count the occurrences of a dimension's value without excluding other values from view?

Yeah that was the issue. I turned my filter into a context filter and it worked out. Thanks a lot Andrew!