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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Count of rows for table visual based on condition and filters

Hey,

I have a visual table in PowerBI that looks something like this but with more data:

Goku100_0-1615865497191.png

I want to count the number of rows for each company where Prime or Not Prime = "Prime"

count prime.PNG

I want this count measure to work with slicers/filters that will be added to the page e.g., If I select "Company A" in the slicer then the KPI for Prime should show a count of 1.

Thanks!

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@Anonymous 

Create a measure, then add the supplier column and the measure in a table visual.

measure = Calculate(count([supplier], filter(Table,Table[Prime or Not Prime] = "Prime"))

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

2 REPLIES 2
V-pazhen-msft
Community Support
Community Support

@Anonymous 

Create a measure, then add the supplier column and the measure in a table visual.

measure = Calculate(count([supplier], filter(Table,Table[Prime or Not Prime] = "Prime"))

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

 
amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

countrows(filter(Table,Table[Prime or Not Prime] = "Prime"))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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