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
Jason_Anderson
New Member

Solution to COUNTA Function?

Hello all, I am very new to Power BI and I'm running into an issue I could use some help with. I assume I need to use CALCULATE / COUNTA for this? This is what I am trying to do:

 

I have two tables and one column in each of those tables I need to compare. Table / Column 1 is QA [ID] and Table / Column 2 is BAT Testing[QA ID]. And the QA IDs are the same in each table. Each QA ID will appear once in the QA Table and many times in the BAT Table.  

 

Basically, what I need to do is come up with calculate function that will total up the number of times an individual QA ID displays in the BAT table. 

 

Edit: I should mention in case it matters, the column for QA ID in the BAT table is a "list" generated based on the ID's in the QA table. The selection isn't freeform. 

4 REPLIES 4
Anonymous
Not applicable

By your descrition it sounds like you could link these tables in the Table relationships section of Power BI.

Next you could create a matrix visual, which you can place the QA [ID] as the Row.
Lastly you could place BAT Testing[QA ID] into the values column and select "Count" as the metric.

 

Power BI will provide the results.

If you need this value as part of a larger measure, because you need the result.  The measure mentioned by @Mi2n will always be context sensitive, so if you are doing something on an ID basis, this should only count the related rows because of the table relationship.

Mi2n
Employee
Employee

count = COUNTA('BAT Testing'[QA ID])

 

This should work.

Thank you for the response. Unfortunately, this does not work. What this does is return the total number of IDs in the column, not the number of matching indicates. 

How about creating a table with one column as QA[ID] and the other column as the calculated measure? Will it not give what you want?

 

 

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.