Forum Discussion
LotteLaugesen
4 years agoHelper V
How to get a default value (zero) when Table.SelectRows doesn't return a value
Hi Is there a way to return zero when [order number] isn't present in FT_table? Here is my query: (let currentOrder = [order number] in Table.SelectRows(FT_Table, each [order number] = currentO...
- 4 years ago
Found a solution - replace error...
- 4 years ago
It's generally better to handle the errors rather than replace them.
Try this:
let currentOrder = [order number], filteredTable = Table.SelectRows(FT_Table, each [order number] = currentOrder)) in try filteredTable{0}[SupplierID] otherwise 0
AlexisOlson
4 years agoSuper User
It's generally better to handle the errors rather than replace them.
Try this:
let
currentOrder = [order number],
filteredTable = Table.SelectRows(FT_Table, each [order number] = currentOrder))
in
try filteredTable{0}[SupplierID] otherwise 0LotteLaugesen
4 years agoHelper V
Thank you so much 😊