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!
I had a similar issue to this, I will try to dig up my solution. But, in essence, what I did was make the expansion/conversion conditional by throwing in an if then else statemetn into the each clause so if null then null otherwise convert
- Anonymous6 years agoNot applicable
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.
- Greg_Deckler6 years agoCommunity Champion
Oh, this is not DAX, this is Power Query and the error you are getting is a Power Query error during data load. It is likely not happening while you are in the editor because the first rows do not exhibit a null but later rows do. Let me see if I can get you an example.
- Greg_Deckler6 years agoCommunity Champion
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