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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
juliaellershaw
Frequent Visitor

Countrows with multiple filters

Hi, I have a table with multiple question numbers and answers that range from 1 to 7. I would like to create a measure that counts the number of rows where the answer for a specific question is equal to 6 or 7.

For example, for this table, I’d like to count the number of times question Q15 was 6 or 7. The answer should be 3

Question Number

Answer

Q13

4

Q13

6

Q14

3

Q14

7

Q15

7

Q15

6

Q15

2

Q15

5

Q15

6

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @juliaellershaw 

You can try this measure:

Count =

CALCULATE(COUNT('Table'[Question Number]),FILTER('Table',[Question Number]="Q15"&&[Answer] in {6,7}))

And place this measure into a card chart, you can get the value 3, like this:

v-robertq-msft_0-1607323332024.png

 

This is my test pbix file

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@juliaellershaw 

 

If you are going to place the Questions on a Table Visual, you can use the following measure which will count based on each Question.

Count Measure = 
CALCULATE(
    COUNTROWS( Table ),
    Table[Answer] IN {6,7}
)

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

v-robertq-msft
Community Support
Community Support

Hi, @juliaellershaw 

You can try this measure:

Count =

CALCULATE(COUNT('Table'[Question Number]),FILTER('Table',[Question Number]="Q15"&&[Answer] in {6,7}))

And place this measure into a card chart, you can get the value 3, like this:

v-robertq-msft_0-1607323332024.png

 

This is my test pbix file

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.