
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count number of string appearances
Hi there,
I have a data set like below.
I would like to count the number of times that RED appears and use that as the expression on a Guage chart.
Can any one help?
Task ID | RAG Status |
---|---|
1 | RED |
2 | GREEN |
3 | GREEN |
- Tags:
- count if
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
if([Status]='Open', Count({<[RAG Status] = {"RED"}>}[RAG Status]), null())
or
if([Status]='Open', Count({<[Status]={'Open'},[RAG Status] = {"RED"}>}[RAG Status]), null())
Will works Fine.In Your Table you should Suppress Null values at Presentation and Dimensions tab as well.
If your dimension is status means there you can see only Open as a field.
HTH,
Hirish
“Aspire to Inspire before we Expire!”

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this:
To count Red
=SubStringCount(Concat([RAG Status], '|'), 'RED')
To count Green
=SubStringCount(Concat([RAG Status], '|'), 'Green')
or
=Count({<[RAG Status] = {'RED'}>}[RAG Status])
=Count({<[RAG Status] = {'GREEN'}>}[RAG Status])

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi There,
This doesn't seem to have worked unfortunately, the count is showing as the total number of rows in the table, rather than the number of instances where the value is RED
Count({<[RAG Status] = {"RED"}>}[Rag Status])
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess would you be able to share a application where it isn't working?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,
Change your Expression like this,
May be its ,
Count({<[Rag Status] = {"RED"}>}[Rag Status])
OR
Count({<[RAG Status] = {"RED"}>}[RAG Status])
“Aspire to Inspire before we Expire!”

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you help me a little bit here too:
So I've just added an if condition.
I want to count the number of RAG status where the status is open.
This doesn't seem to work - to confirm, the count now does work. Just need the if to work around it.
if([Status]='Open', Count({<[RAG Status] = {"RED"}>}[RAG Status]), null())

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
if([Status]='Open', Count({<[RAG Status] = {"RED"}>}[RAG Status]), null())
or
if([Status]='Open', Count({<[Status]={'Open'},[RAG Status] = {"RED"}>}[RAG Status]), null())
Will works Fine.In Your Table you should Suppress Null values at Presentation and Dimensions tab as well.
If your dimension is status means there you can see only Open as a field.
HTH,
Hirish
“Aspire to Inspire before we Expire!”
