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
Pewima
Regular Visitor

Just getting started - and stuck already :)

Hi everybody,

 

I am just getting started with PowerBI, and stuck already :). Here is my question:

 

I have 2 tables. 

 

Table A holds unique IDs: 

1

2

3

4

 

Table B holds the same IDs and Country Names:

1 Belgium

2 Belgium 

2 France

2 China

3 France

4 France

4 Belgium

 

What I would like to do is add a column to Table A providing a sum of the number of distinct countries in which the ID is available. In other words, Table A should become:

 

1 1

2 3

3 2

4 1

 

Any ideas on how I can best achieve this?

 

Thanks so much!
Mark

1 ACCEPTED SOLUTION
David4F
Advocate I
Advocate I

Hi

 

Create a relationship between table a and table b on ID's then create a DAX measure

 

CountryCount = (COUNTROWS(Table2))

 

Kind Regards

 

David

View solution in original post

1 REPLY 1
David4F
Advocate I
Advocate I

Hi

 

Create a relationship between table a and table b on ID's then create a DAX measure

 

CountryCount = (COUNTROWS(Table2))

 

Kind Regards

 

David

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.