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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

CSV values to an individual item in a drop down list

My current drop down list is something like below, and how can I have convert CSV values to an individual item in a drop down list?

Screenshot_2020-06-12 APJ EMAIL STATUS - Power BI.png

 

Sample data:

IDPromotionCategoryContent TypeEmail GoalCountriesSEND DATE
WR762443NoConsumablesAwarenessOpen RateAA, KR, TWMonday, January 20, 2020
WR862444YesConsumablesWebinarOpen RateSA, SG, KR, TWThursday, February 20, 2020
WR563248NoConsumablesVideoClick Thru RateAAMonday, January 20, 2020
WR363249NoConsumableseComClick Thru RateAA, SA, SG, KR, TWMonday, February 17, 2020
WR764639NoConsumablesPromoClick Thru Rate SG, TWTuesday, January 14, 2020
WR864640NoConsumablesAwarenessClick Thru RateAA, SATuesday, January 28, 2020
1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @Anonymous , 

As mentioned above, you could use convert this in power query. You could refer to my sample for details.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("hZFdC8IgFIb/iuzai+XMrcsICoo+WKMR0YWrA42ahibRv08XfWw4ulA8B3keX89uF+RpzAilUYCDhbTbSAptKl5cQNtqeOcKBGh3Xl5BoJTfwPWHGM1SjLLcFnMpjvyB0ZQLw9UDkRDbRcJgjx0/cXxq721rZFOQQ1EKrlr4tcWvJz+K7GSUriVjKJTP0mcRoYk/xaY8Qt29lIczyk7KfHP8f3/kyAM/GUay6gDbBO0Ub9EnQy9umGJGWdRhWilZ+TPUjtcvGdCNJD3amgRlNPw/6a44PgVJ3or9Ew==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t, Promotion = _t, Category = _t, #"Content Type" = _t, #"Email Goal" = _t, Countries = _t, #"SEND DATE" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", type text}, {"Promotion", type text}, {"Category", type text}, {"Content Type", type text}, {"Email Goal", type text}, {"Countries", type text}, {"SEND DATE", type date}}),
    #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "Countries", "Countries - Copy"),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Duplicated Column", "Countries - Copy", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Countries - Copy.1", "Countries - Copy.2", "Countries - Copy.3", "Countries - Copy.4", "Countries - Copy.5"}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Split Column by Delimiter", {"ID", "Promotion", "Category", "Content Type", "Email Goal", "Countries", "SEND DATE"}, "Attribute", "Value"),
    #"Removed Columns1" = Table.RemoveColumns(#"Unpivoted Columns",{"Attribute"})
in
    #"Removed Columns1"

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
dax
Community Support
Community Support

Hi @Anonymous , 

As mentioned above, you could use convert this in power query. You could refer to my sample for details.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("hZFdC8IgFIb/iuzai+XMrcsICoo+WKMR0YWrA42ahibRv08XfWw4ulA8B3keX89uF+RpzAilUYCDhbTbSAptKl5cQNtqeOcKBGh3Xl5BoJTfwPWHGM1SjLLcFnMpjvyB0ZQLw9UDkRDbRcJgjx0/cXxq721rZFOQQ1EKrlr4tcWvJz+K7GSUriVjKJTP0mcRoYk/xaY8Qt29lIczyk7KfHP8f3/kyAM/GUay6gDbBO0Ub9EnQy9umGJGWdRhWilZ+TPUjtcvGdCNJD3amgRlNPw/6a44PgVJ3or9Ew==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t, Promotion = _t, Category = _t, #"Content Type" = _t, #"Email Goal" = _t, Countries = _t, #"SEND DATE" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", type text}, {"Promotion", type text}, {"Category", type text}, {"Content Type", type text}, {"Email Goal", type text}, {"Countries", type text}, {"SEND DATE", type date}}),
    #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "Countries", "Countries - Copy"),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Duplicated Column", "Countries - Copy", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Countries - Copy.1", "Countries - Copy.2", "Countries - Copy.3", "Countries - Copy.4", "Countries - Copy.5"}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Split Column by Delimiter", {"ID", "Promotion", "Category", "Content Type", "Email Goal", "Countries", "SEND DATE"}, "Attribute", "Value"),
    #"Removed Columns1" = Table.RemoveColumns(#"Unpivoted Columns",{"Attribute"})
in
    #"Removed Columns1"

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

speedramps
Super User
Super User

Hi lostinspace

 

Please consider this solution and leave kudos ...

 

In the power query editor click on your countries column > split by column > split by delimniter

Click advanced>rows>ok

 

This will create one row per id / country.

 

You can use this instead of your orginal table or as a 1 to many relationship by id. 

 

Add the country column to your drop down and this will select just what you want.

 

Alternatively, you can use search string options but the above method will be a lot faster.

 

mahoneypat
Microsoft Employee
Microsoft Employee

You can do that by adding a custom column with Text.Split([Countries], ", "), and click on the expand arrows of the list that is created and choose "Expand to New Rows".  This will duplicate all the other columns but create a new row for each of the Countries.  This may affect other existing measures, so you may consider referencing your original table in the query editor, keeping a key column to relate them later and your countries column, and perform this transformaton.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Pragati11
Super User
Super User

Hi @Anonymous ,

 

You can achieve this Query Editor in Power BI:

  1. Split Country column on "," separator
  2. Select all the splitted columns and Unpivot selected columns.

You should end up what you are looking for. Let me know if you need more details on this.

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Solution Authors