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
saranp780
Helper III
Helper III

Anybody, Who knows countif from another table?

I am a new user from Power BI. I tried to use count DAX like COUNTIF in Excel but now, I can't do it. For example, if I have 2 tables of data

 

 

Table 1 (sheet1)

(A)                                 (B)

username                     Name of staff

Account01                        Narinthip

Account02                        Edward

Account03                        John

Engineer01                       Sarin

Engineer02                       Tom cruise

Engineer01                       Cavalry

Account02                        Sarin

Account03                        Cavalry

 

Table 2 (sheet2)

 

 (A)                                (B)

User                             Owner

Account01                  Account Dep.

Account02                  Account Dep.

Account03                  Account Dep.

Engineer01                 Engineer Dep.

Engineer02                 Engineer Dep.  

 

So I want to count user from table 2 that how many people use per user? Such as Account02 use two people.

 

If in Excel I can use Countif (formula) =COUNTIF(SHEEET1!$A:$A,Sheet2!$A:$A)

I want to do this also in Power BI.

 

Best regard.

 

1 ACCEPTED SOLUTION

Hi,

 

First, create a relationship between Table2[User] and Table1[UserName] fields.

Second, create the following measure: Cnt = Countrows(Table1)

 

Third, create a matrix visual, use  Table1[UserName] field as X-Axis and the measure "Cnt" in the values field of this matrix.

View solution in original post

1 REPLY 1

Hi,

 

First, create a relationship between Table2[User] and Table1[UserName] fields.

Second, create the following measure: Cnt = Countrows(Table1)

 

Third, create a matrix visual, use  Table1[UserName] field as X-Axis and the measure "Cnt" in the values field of this matrix.

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.