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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
ACraig08
Helper III
Helper III

Getting List.Count for each column Power Query

Hello,

I have a table like this:

Screenshot 2023-12-28 122954.png

 

I have been trying to find a way to convert each column so that they are a count of the number of items in each list for each row. One company used to have multiple rows and I used the Group By function first, then Aggregated Rows using List.Distinct so it have me a the result above. The end goal is the count within each list. I have been having the hardest time and am hoping I can avoid having to manually make a custom column for each one since I have like 30 columns. Any help is greatly appriciated.

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

to know how to do this watch my video

https://1drv.ms/v/s!AiUZ0Ws7G26RjFLL9CsEaSzn-65a?e=ENQDED

 = List.Skip( Table.ColumnNames( from),1)
 = Table.ReplaceValue( from, (x)=> x,(x)=>x, (x,y,z)=> List.Count(x), listmy)

 

View solution in original post

2 REPLIES 2
Ahmedx
Super User
Super User

to know how to do this watch my video

https://1drv.ms/v/s!AiUZ0Ws7G26RjFLL9CsEaSzn-65a?e=ENQDED

 = List.Skip( Table.ColumnNames( from),1)
 = Table.ReplaceValue( from, (x)=> x,(x)=>x, (x,y,z)=> List.Count(x), listmy)

 

OMG that was amazing! You also taught me how to had a function/step without having to chose one of the ones from the ribbion! I didn't know you could select the Screenshot 2024-01-02 083000.png symbol to insert your own thing! Thank you!!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.