CountIf more than expression shows values that it should not

Hello! I have been trying to create a graph that draws Order information from one of our tables, and to get it to display which stores have more than 20 menu views per month, ignoring any that have under 20 menu views.

I've been trying to use the CountIf function in a custom expression, written as such CountIf([Status] < 20) and a filter that will only display orders who's Status is DRAFT ( these are orders that have never gone through, each time someone views a store's catalog, it registers a DRAFT order )

One thing I've noticed though is that, regardless of me telling the CountIf expression to take into account only those that are over 20 views, it still displays those that are also under 20. When I reverse it, just for experimentation sake, it displays 0.

I am an absolute newbie at this, and I'd appreciate all the help I can get in trying to understand what I may be doing wrong.

Thank you in advance!

Hi @IanGO
CountIf([Status] < 20) does not mean CountIf([Status] = "DRAFT")
So you'll first have to get the correct count, which you then create a Filter section after.

How would I be able to get the correct count of orders that have the DRAFT status?

@IanGO Use CountIf([Status] = "DRAFT") or make a Filter before the Summarize section.
I would recommend looking through the Learn material, which gives you a good start https://www.metabase.com/learn/getting-started/getting-started

Example filter before summarize, and then just use a regular Count instead of CountIf

1 Like