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

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

Reply
TJohnson6754
Frequent Visitor

How to visualize count of list components in column

Hi there,

I'm newer at this and need help with what seems like it should be simple but hasn't been (for me) so far:

 

My table contains a column that contains list data.

 

Example data: 

IDList
1dog,cat,iguana
2horse,dog
3cat,hamster
4horse,iguana
5
horse,cat,hamster

 

I want to be able to visualize the data in Power BI similar to this:

TJohnson6754_0-1675117566539.png

What I've tried:

  • I made measures, each measure counts one component in the column, then I'm unable to add the measures to visualize them as separate bars on the bar chart.
  • I've made separate columns for each list component, each one with a 1 or 0 depending on whether that row contains the list component of interest.
  • I tried using dax to make new tables, one for each list component, with the intention to append them to one another, but I wasn't able to append these types of tables in "Transform Data". 
    • PetsDog = SELECTCOLUMNS(FormResponses,"Pet",if(CONTAINSSTRING(FormResponses[List],"dog"),"dog",""))​
    • PetsCat = SELECTCOLUMNS(FormResponses,"Pet",if(CONTAINSSTRING(FormResponses[List],"cat"),"cat",""))​
    • etc.

 

 

Is there a simple (or complicated) way to do this?

1 ACCEPTED SOLUTION
alekhved
Resolver I
Resolver I

hi @TJohnson6754 

 

I created a temp table just like the table shown above and followed the certain steps in Power BI Query editor to create a new table which could help solve your problem.

 

Temp Table

 

alekhved_0-1675123136529.png

 

 

 

Steps followed in Query Editor

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUUrJT9dJTizRyUwvTcxLVIrViVYyAgpn5BcVp+oAJcEixkARkKKMxNziktQipdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, List = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"List", type text}}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "List", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"List.1", "List.2", "List.3"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"List.1", type text}, {"List.2", type text}, {"List.3", type text}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type1", {"ID"}, "Attribute", "Value"),
#"Removed Columns" = Table.RemoveColumns(#"Unpivoted Columns",{"Attribute"})
in
#"Removed Columns"

 

Output at end of all steps

 

alekhved_1-1675123180308.png

 

Again, this solution is based on assumption that you have  "," as delimiter. And you are not much worried about multiple records with the same ID (different list name though)

 

Hope this helps!!

alekh

 

View solution in original post

2 REPLIES 2
alekhved
Resolver I
Resolver I

hi @TJohnson6754 

 

I created a temp table just like the table shown above and followed the certain steps in Power BI Query editor to create a new table which could help solve your problem.

 

Temp Table

 

alekhved_0-1675123136529.png

 

 

 

Steps followed in Query Editor

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUUrJT9dJTizRyUwvTcxLVIrViVYyAgpn5BcVp+oAJcEixkARkKKMxNziktQipdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, List = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"List", type text}}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "List", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"List.1", "List.2", "List.3"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"List.1", type text}, {"List.2", type text}, {"List.3", type text}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type1", {"ID"}, "Attribute", "Value"),
#"Removed Columns" = Table.RemoveColumns(#"Unpivoted Columns",{"Attribute"})
in
#"Removed Columns"

 

Output at end of all steps

 

alekhved_1-1675123180308.png

 

Again, this solution is based on assumption that you have  "," as delimiter. And you are not much worried about multiple records with the same ID (different list name though)

 

Hope this helps!!

alekh

 

This worked for me, thank you so much!

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.