How to replce "Nan" to 0 in Power Query

Alex Wong 21 Reputation points
2020-12-22T09:35:02.123+00:00

Hi all,
I have to calculate % of my sales in Power Query, I have used Custom Column function and have the result with "Infinity" and "NaN" appear due to some data were divided by 0, I could use replace function to change all the "Infinity" to 0, but the same function couldn't work for "Nan", does anyone could help me on this problem?? many thanks

50398-formula.png

50431-result.png

Community Center | Not monitored
0 comments No comments
{count} votes

Accepted answer
  1. Lz._ 9,016 Reputation points
    2020-12-22T11:23:40.753+00:00

    Hi @Alex Wong

    This should do what you want w/o having to replace Nan/Infinity later:

    50471-demo.png

    4 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.