Forum Discussion
Cannot Expand Null List
- Anonymous6 years ago
Well, that was it! Finally got it to load. Thanks for the help Greg_Deckler . Even though that wasn't the answer it was the only thing that allowed me to find the issue! Thanks!
Thanks Greg_Deckler, I've been having issues even telling whether a list is null since it's nested. I'm fairly new to dax though, so I may be doing something wrong. It's been difficult to track down the issue since it only occurs when I try to load it in the report. It's strange that it works fine in the editor.
Here is a simple example.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWAhNGSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if [Column1] = "" then 0 else Number.FromText([Column1]))
in
#"Added Custom"
You could create a new column where you check if the other column is null and if so return null or "", etc. Otherwise, (else) you would just plug in your List expansion code. Anonymous
- Anonymous6 years agoNot applicable
Well that shows how familiar I am with this, Power Query then.
I'm still a little lost. I do see nulls in the editor and it is transforming them fine, which is the really weird part.
I understand in principle what you're saying, and that sounds like a good plan, but I'm unsure how to do it in this example. In short, I have a list that is transformed into 4 lists of values. I then zip those up. Prior to zipping some of the lists were null, but they still showed. Once zipped now the zip is null since it removes that top layer of lists. Now I have some that are zipped lists of lists and some that are null. I try to convert those lists to records so they can be expanded and that's where it fails. I need to be able to see if they are null before and delete them. I have tried List.IsEmpty(), but that doesn't seem to work
I tried the snippet you sent to create a new column and they all came back as not null. Probably since they are a list
- Anonymous6 years agoNot applicable
but..... I decided to use list.IsEmpty() with creating a new column and I found my issue. It may not have been the nulls after all.... It seems two of the zipped lists have an error in them. It must have occurred in an earlier step, but I never saw it since it didn't show as errored at the top and I never looked inside all the lists. I'm gonna do some digging
- Anonymous6 years agoNot applicable
So the error occurred before zipping. I never saw it since it was all zipped up, but some of the lists were null before zipping. As in they themselves are null, not filled with nulls. So now I need to remove those before zipping. Any tips?