Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Bebo
Helper II
Helper II

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 1
ValtteriN
Super User
Super User

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!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.