Forum Discussion
Revokez
6 years agoFrequent Visitor
Filtering by whether Image Exists or Not
Hi I've got a table of data that includes a column that pulls in an image URL using the Data Category: Image URL. However some of these images exist and some of these images don't exist. This mea...
- 6 years ago
Hi Revokez ,
We can add a custom in power query editor to identify if this url is valid:
let ContentType = Binary.InferContentType(Web.Contents([Address]))[Content.Type], t = Table.RemoveRowsWithErrors(#table({"Type"} ,{{if Text.Contains(ContentType,"image") then 1 else null}} )), RemoveNull = Table.SelectRows(t,each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null}))) in not Table.IsEmpty(RemoveNull)Then you can use it in any filter you want.
If you are using the local file address, try to use the File.Content instead of Web.Content
Best regards,
v-lid-msft
6 years agoCommunity Support
Hi Revokez ,
We can add a custom in power query editor to identify if this url is valid:
let
ContentType = Binary.InferContentType(Web.Contents([Address]))[Content.Type],
t = Table.RemoveRowsWithErrors(#table({"Type"} ,{{if Text.Contains(ContentType,"image") then 1 else null}} )),
RemoveNull = Table.SelectRows(t,each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null})))
in
not Table.IsEmpty(RemoveNull)
Then you can use it in any filter you want.
If you are using the local file address, try to use the File.Content instead of Web.Content
Best regards,
Revokez
6 years agoFrequent Visitor
v-lid-msft , that's exactly what I was after - perfect, thank you very much!