This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi can anyone help me on my visual calcualtion result,
if the result is blank will be equal to 0
if the result is NaN will be equal to 0
Thank you
Solved! Go to Solution.
Hi,
I am not sure how your semantic model looks like, but please try something like below.
Please check the below picture and the attached pbix file.
Hi @AllanBerces
ideal way of handling NaN will be in DiIVIDE DAX function or PowerQuery.
add below powerquery step to convert NaN to null
#"Added Conditional Column" = Table.AddColumn(#"Replaced Value", "Custom", each if [#"%Actual_rev"]<> null and Number.IsNaN([#"%Actual_rev"]) then null else [#"%Actual_rev"])
// replace [#"%Actual_rev"] with column which has NaNafter handling the NaN, you can try below Visual Calculation.
[%Actual_rev] = format(SWITCH(TRUE(),
ISBLANK( [Earned]/[Total Hrs]),0
, [Earned]/[Total Hrs]
),"0")Please give Kudos or mark it as solution once confirmed.
Thanks and regards,
praful
Hi @AllanBerces
ideal way of handling NaN will be in DiIVIDE DAX function or PowerQuery.
add below powerquery step to convert NaN to null
#"Added Conditional Column" = Table.AddColumn(#"Replaced Value", "Custom", each if [#"%Actual_rev"]<> null and Number.IsNaN([#"%Actual_rev"]) then null else [#"%Actual_rev"])
// replace [#"%Actual_rev"] with column which has NaNafter handling the NaN, you can try below Visual Calculation.
[%Actual_rev] = format(SWITCH(TRUE(),
ISBLANK( [Earned]/[Total Hrs]),0
, [Earned]/[Total Hrs]
),"0")Please give Kudos or mark it as solution once confirmed.
Thanks and regards,
praful
Hi,
I am not sure how your semantic model looks like, but please try something like below.
Please check the below picture and the attached pbix file.
I'm glad you found a solution! We're here in the community to support each other. 🤝
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 28 | |
| 28 | |
| 20 | |
| 18 |
| User | Count |
|---|---|
| 65 | |
| 35 | |
| 33 | |
| 25 | |
| 24 |