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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
tomsaxton10
New Member

Expanding items in 'List' in column when some cells are blank

I am trying to expand the items in 'List' out as they form part of a PowerBI table. Currently, that table is just showing 'List' rather than the separate items that sit within list. 

 

Any suggestions?

 

View of the columnView of the columnList itemsList items

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @tomsaxton10 ,

 

Please follow these steps:

 

1. Right-click the List --> Select To Table

Eyelyn9_1-1637650218360.png

 

2. Add a Custom column:

= if [Column1]="" then {""} else [Column1]

Eyelyn9_2-1637650241933.png

 

3. Click the Expand icon-->Expand to New Rows:

Eyelyn9_3-1637650401350.png

4. Remove the original column and filter out blank rows:

Eyelyn9_4-1637650486007.png

 

 

Final output:

Eyelyn9_6-1637650529688.png

 

 

Best Regards,
Eyelyn Qin
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

7 REPLIES 7
Anonymous
Not applicable

Hi @tomsaxton10 ,

 

Please follow these steps:

 

1. Right-click the List --> Select To Table

Eyelyn9_1-1637650218360.png

 

2. Add a Custom column:

= if [Column1]="" then {""} else [Column1]

Eyelyn9_2-1637650241933.png

 

3. Click the Expand icon-->Expand to New Rows:

Eyelyn9_3-1637650401350.png

4. Remove the original column and filter out blank rows:

Eyelyn9_4-1637650486007.png

 

 

Final output:

Eyelyn9_6-1637650529688.png

 

 

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

Thanks for your response Evelyn. For some reason, I don't have the option to select 'To table' when I right-click the list. Any thoughts as to why that might be the case as I am stumped! 

 

Also, I don't want to filter out the blank rows as I am counting the data in those blank rows for a different part of the PowerBI dashboard. When I filter out blanks, it removes them and will impact the data on my dashboard. 

Anonymous
Not applicable

Hi @tomsaxton10 ,

 

Please try to create a blank query and paste the below M syntax in Advanced Editor dialog:

Eyelyn9_0-1640163764246.png

 

let
    Source ={
"","","",{"Technical","Operational","Legal"},"","",{"Desktop","Service"},{"Milk","Egg","Bread","Rice"},{"Mouse","Keyboard"},""
},
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Added Custom" = Table.AddColumn(#"Converted to Table", "Custom", each if [Column1]="" then {""} else [Column1]),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Column1"})
in
    #"Removed Columns"

 

Best Regards,
Eyelyn Qin

BA_Pete
Super User
Super User

Hi @tomsaxton10 ,

 

You could try using Table.ExpandListColumn:

Table.ExpandListColumn(previousStep, "Outcome Category")

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Hi Pete,

 

Thanks for the quick response. I have tried this (I think) but got the following error message. 

 

Capture4.PNGCapture3.PNG

@tomsaxton10 ,

 

You could try just running the code I gave you as a custom step, rather than a new column, but I suspect the issue is actually due to the blank rows.

 

Add  a new custom column like this to generate a column that can be expanded using the GUI:

if [Outcome Category] = "" then {99999..99999} else [Outcome Category]

Substitute the '99999's with any number you want, as long as both entries are the same.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Yeah, I think it would work with nulls rather than empty strings, as mentioned in these posts:
https://community.powerbi.com/t5/Power-Query/SharePoint-List-and-null-values/m-p/1763308

https://community.powerbi.com/t5/Desktop/Custom-columns-in-a-SharePoint-Page-Library/m-p/2176571

 

These use a column transform with this function:

if Value.Is(_, type list) then _ else null

and then expand.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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