Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting DAX to return 0 instead of Blank

Tags:

powerpivot

dax

Using PowerPivot and DAX Countrows along with filter option with a column that has six possible expressions. (Excellent, Good, Acceptable, Not good, Poor and Blank). Post count, I am calculating Satisfaction percentage by Dividing Excellent and Good by the Total responses. My problem is that the countrows function does not take blank as 0 and thus screws up my calculation. How do I get around this?

like image 656
Setu Avatar asked Nov 29 '25 11:11

Setu


1 Answers

A simple yet effective trick I've always used: add + 0 to your measure.

Data with only "A" and "B":

data

Before:

before

After adding + 0:

after

like image 160
Foxan Ng Avatar answered Dec 02 '25 05:12

Foxan Ng



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!