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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Count the number of values in a list that match the current value

Hi everyone

I have a table CUSTOMER where there is a customer key that is a unique value and a list where that customer key is duplicated for each transaction the customer has done. I would like, in Power Query, to count the number of transactions per customer. Therefore I need to count the number of values in the list that are equal to the ID of the current row, for each row.

The reason I am not doing this in DAX is that I need this number to perform filtering on the table and eliminate some rows. 

How can I do it? Thanks 

2 REPLIES 2
AlB
Community Champion
Community Champion

Hi @Anonymous 

you can create a custom column with this code, where "IDColumn" is the name of the column with the IDs and "ListColumn" the name of the column with the lists:  

List.Count( List.Select ( [ListColumn],  (inner)=> inner = [IDColumn] ) )

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs

Cheers 

SU18_powerbi_badge

 

Anonymous
Not applicable

This looks correct and works rapidly when creating the column in PowerQuery but it's extremely slow when applying the query change. Is it normal or should it work smoothly?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors