Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello,
could anyone tell me what is wrong with the following statement:
Column = IF Query[CR] = NaN then 0 else Query1[CR]
Thank you,
Ekaterina
= NaN won't work either in Power Query.
Working example query:
let
Source = Table.FromList({1,#nan,2}, Splitter.SplitByNothing(), {"CR"}, null, ExtraValues.Error),
#"Added Custom" = Table.AddColumn(Source, "Custom", each if Number.IsNaN([CR]) then 0 else [CR])
in
#"Added Custom"
@Anonymous well I select Query1[CR] as Power BI advices me in the bar so it knows from which query am I selecting CR. I have tried to replaced IF for if and tried both without Query1 and with it, but it returns me an error anyway. It says that ''the syntax for ´then´ is incorrect. (DAX(IF (Query1[CR] = NaN then 0 else Query1[CR]))).''
@MarcelBeug's reply should work for Power Query.
For DAX you can try
Column = IF(Query[CR]="NaN","0",Query[CR]) or Column 2 = IF(ISBLANK(Query[CR]),"0",Query[CR])
Your Query seems to be a DAX Query..
@MarcelBeugand I posted you Power Query solutions (I have to admit, that only @MarcelBeug solution works, as I've overlooked the NaN issue....)..
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 61 | |
| 59 | |
| 42 | |
| 18 | |
| 15 |
| User | Count |
|---|---|
| 109 | |
| 101 | |
| 39 | |
| 29 | |
| 29 |