Forum Discussion

Bebo's avatar
Bebo
Helper II
4 years ago

Measure to Count Rows that Meet Two Criteria

I have a table that contains three primary columns - Location (Text), Event Type (Text) and Event Value (Number). I have been trying to define a measure that will count the number of rows that meet specific criteria. For example, if Location=X and Event Type=Y and Event Value =Z, than count that row and summarize. Following is sample data:

Date / TimeLocationEvent TypeEvent Value
 Los AngelesValve0
 Los AngelesFeed1
 DallasFeed1
 San AntonioFeed 
    
    
    
    

So, in the example above, count the number of rows that meet this criteria: Location = Dallas, Event Type=Feed,Event Value=1

Any ideas?

1 Reply

  • ValtteriN's avatar
    ValtteriN
    Community Champion

    Hi, 

    You can use FILTER combined with countrows.

    E.g. 

    Measure = COUNTROWS(FILTER(table,column1=state1&&column2=state2&&column3=state3))
    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!