首页 > 解决方案 > Replace null value in Table before TransformColumns

问题描述

In a PowerBI datasource I have a table with a Column "SPRINT" in one Column. This column contains a LIST of values or null (value comes from JIRA API).

enter image description here

In the next step I extract the values using Table.TransformColumns to geht the string out:

= Table.TransformColumns(#"PREVIOUS", {"Sprint", each Text.Combine(List.Transform(_, Text.From), ";"), type text})

Result:

enter image description here

in the next steps I do a SplitColumn in order to get the information out of this SPRINT string that I want to have.

In the end, all rows where SPRINT was null end in several columns with ERROR.

So my question is, how can I manage to prevent getting all those errors? Ideally I would expect to transform the SPRINT Column values where SPRINT is null into something that does not end with ERROR and avoid the execution of SPLIT function in case it does not make any sense.

I managed to add Table.ReplaceErrorValues in the end for all affected columns - and this works but it seems to be quite an overhead to me and I try to keep the transformations as slim as possible because the JIRA API is slow and tending to timeout with a specific number of rows and operations.

Thanks for helping out!

标签: error-handlingpowerbipowerquerypowerbi-desktopm

解决方案


如果它为 null,您可以在展开后简单地再添加一个步骤,并将 error 替换为 null 或您期望针对 null 的任何其他值。


推荐阅读