cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
JSaunders
Frequent Visitor

Counting how many rows within 'Groups' in Table01 Contain the individual Group names within Table02

Hey all,

 

So I have two tables:

Table01, which countain a list of Assets, with one column being a list of Groups it belongs to - Comma seperated.

Table02, which was generated as a seperate table to contain all of these independent Group names, de-duplicated and cleaned.

 

I would like to add another column within Table02 to show many Assets within Table01 are part of this specific group, but I can't seem to find something that works across tables (no relation) utlising Contains.

 

A brief view...

 

Table01:

Asset Name | Groups

Asset01 | Group01, Group03

Asset02 | Group02

Asset03 | Group02, Group03

 

Table02:

Group Name | Number of Assets

Group01 | ?

Group02 | ?

Group03 | ?

 

Any help would be very much appreciated!

Thanks in advance.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@JSaunders , new column in table 2

 

countx(filter(Table1, containsstring(Table1[Group], Table2[Group])), Table1[Assets])

 

or

 

calculate(distinctCOUNT(Table1[Assets]) , filter(Table1, containsstring(Table1[Group], Table2[Group])))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@JSaunders , new column in table 2

 

countx(filter(Table1, containsstring(Table1[Group], Table2[Group])), Table1[Assets])

 

or

 

calculate(distinctCOUNT(Table1[Assets]) , filter(Table1, containsstring(Table1[Group], Table2[Group])))

Perfect! the CountX option worked like a dream.

 

Thanks for the help.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors