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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Grewin
Frequent Visitor

Count how many times the ID in sheet A shows up in sheet B

I wanted to count how many times the ID in sheet A shows up in sheet B.

 

Sheet A:

Page TagId
A1259
B1221
C1223
D763
E1247
F1237
G1235

 

Sheet B:

Tag Ids
923, 815, 763, 1235
851, 1259
903, 899, 927, 935
915, 921, 815, 1223
1235
564, 737, 1259, 1223
943, 1197, 1247, 1125, 1123, 1195, 1235, 1237

 

 

Desired Output:

Page TagCount
A2
B0
C2
D1
E1
F1
G3

 

Thank you in advance.

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @Grewin ,

 

My steps are:

1. In Power Query Eidtor -> Split column by delimiter -> select all column -> unpivot column

vcgaomsft_0-1666074563204.png

vcgaomsft_1-1666074733733.png

2. In Sheet A -> Merge queries -> aggregate

vcgaomsft_2-1666075430589.png

vcgaomsft_5-1666076572537.png

3. result:

vcgaomsft_6-1666076605715.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @Grewin ,

 

My steps are:

1. In Power Query Eidtor -> Split column by delimiter -> select all column -> unpivot column

vcgaomsft_0-1666074563204.png

vcgaomsft_1-1666074733733.png

2. In Sheet A -> Merge queries -> aggregate

vcgaomsft_2-1666075430589.png

vcgaomsft_5-1666076572537.png

3. result:

vcgaomsft_6-1666076605715.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

amitchandak
Super User
Super User

@Grewin , Split the column tag id in table two into rows

https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/

 

And group the table with count (if needed duplicate)

https://docs.microsoft.com/en-us/power-query/group-by

 

Then merge the two tables.

 : https://radacad.com/append-vs-merge-in-power-bi-and-power-query

 

or Also step 1

 

come to DAX and create a new column in Table 1

 

COuntx(filter(Table2, Table1[Tag id] = Table2[Tag_ids]) , Table2[Tag id])

 

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.