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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Counting specific outcome from a measure that is in another table

Hi, 

I have a matrix table that pulls together and aggregates various columns from different tables and in the same matrix table a measure that returns a yes/no for each row within the table. 

What I would like to do next is create a new measure in a card above that does a count of the measure in the matrix table for all the "Yes" outcomes. 

Have not been able to crack it or find anything online to help, so hoping someone on here can help? 🙂

 

Thanks,

 

Ben

1 ACCEPTED SOLUTION

Thanks for the additional info.  Still not totally clear on your scenerio but please try this expression

 

Yes Count =
COUNTROWS (
    FILTER (
        SUMMARIZE ( Core, Core[Name], Core[Type], Core[Size] ),
        [Variance Status ‘Yes/No’] = "Yes"
    )
)

 

Pat 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

5 REPLIES 5
mahoneypat
Microsoft Employee
Microsoft Employee

Please try a measure expression like this for your card, where column1 and column2, etc. are the columns used in your matrix visual.

 

Yes Count =
COUNTROWS (
    FILTER (
        SUMMARIZE ( Table, Table[Column1], Table[Column2] ),
        [Your YesNo Measure] = "Yes"
    )
)

 

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Thanks for the response @mahoneypat  but I couldn’t get that to work, I just get a BLANK return in the card.  I think I might not be filling in the DAX correctly so I've provided more detail on my matrix table below.

 

Rows:

Table Core: Name

Table Core: Type

Table Core: Size

 

Values

Table 2000: Units

Table 2001: Units

Table 2000: Cost

Table 2001: Cost

Measure 1: Variance

Measure 2: Variance Status ‘Yes/No’

 

So how would I structure that DAX to count measure 2 for the number of Yes?

Thanks for the additional info.  Still not totally clear on your scenerio but please try this expression

 

Yes Count =
COUNTROWS (
    FILTER (
        SUMMARIZE ( Core, Core[Name], Core[Type], Core[Size] ),
        [Variance Status ‘Yes/No’] = "Yes"
    )
)

 

Pat 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Thanks again , appreciate your patience 😊 however still can't get this working. I've tried to add more information below to help understand what I've got. 

I’m working with 3 tables; 

The Main which I'm using 3 fields; Name, Type and Size and then the other two tables link to this in a 1-2-1 relationship based on a unique ref number. These other two tables are for previous year and current year and hold quantities and costs. 

Finally I have two measures, the first being a variance of the cost for year and year in a percentage format and then the second measure is checking which are out of tolerance by yes/no and it’s a count of this second measure that I want to get and add into a card.

 

Then added into my matrix table, aggregated as shown below.

 

Matrix RowMatrix RowMatrix RowMatrix ValueMatrix ValueMatrix ValueMatrix ValueMatrix ValueMatrix Value
NameTypeSize2020 Units2021 Units2020 AVG Cost2021 AVG CostVarianceTolerance Out
Fitzgernal inccommericallarge10015098.331057%Yes

 

I have tried the expression you have suggested but it just returns (BLANK)

Anonymous
Not applicable

Yay sucess! I'm not sure exactly what I did differently but it's working now. Thanks for the help @mahoneypat 

Ben

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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