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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Count of multiple selections

I've a sharepoint that I use to report results. One of the columns in the sharepoint has multi selection.

How can I find a way to create visualization when there are multi-selections?

 

e.g.

IDNamePreferred Colors
1JohnRed, Blue, White
2MarieWhite, Blue, Red
3SteveWhite, Red
4AllisonPink, Red

 

I want to be able to have a table that looks like this:

ColorCount
Red4
Blue2
Pink1
White3

 

The SharePoint column shows in PowerBI as [List]

YJAMOUS_0-1636482558430.png

 

When I try to expand it, it looks like this

 

["Red", "Blue", "White"]

["White", "Blue", "Red"]

["White", "Red"]

 

Thanks in Advance

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download sample PBIX file

 

You can extract the Lists to separate rows in Power Query

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUfLKz8hTitWJVjICcnwTizJTwTxjIC+4JLUMwjMB8hxzcjKL84FqYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Name = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Name", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Preferred Colors", each if [Name] = "John" then {"Red", "Blue", "White"} 

else if [Name] = "Marie" then {"White", "Blue", "Red"}

else if [Name] = "Steve" then {"White", "Red"} 

else {"Pink", "Red"}),
    #"Expanded Preferred Colors" = Table.ExpandListColumn(#"Added Custom", "Preferred Colors")
in
    #"Expanded Preferred Colors"

 

countcol1.png

countcol2.png

 

 

Close PQ then add a table showing Preferred Colors in the 1st column and Count of Preferred Colors in the 2nd column

countcol.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

1 REPLY 1
PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download sample PBIX file

 

You can extract the Lists to separate rows in Power Query

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUfLKz8hTitWJVjICcnwTizJTwTxjIC+4JLUMwjMB8hxzcjKL84FqYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Name = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Name", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Preferred Colors", each if [Name] = "John" then {"Red", "Blue", "White"} 

else if [Name] = "Marie" then {"White", "Blue", "Red"}

else if [Name] = "Steve" then {"White", "Red"} 

else {"Pink", "Red"}),
    #"Expanded Preferred Colors" = Table.ExpandListColumn(#"Added Custom", "Preferred Colors")
in
    #"Expanded Preferred Colors"

 

countcol1.png

countcol2.png

 

 

Close PQ then add a table showing Preferred Colors in the 1st column and Count of Preferred Colors in the 2nd column

countcol.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.