Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PowerBI Differentiate BLANK value and 0 value

Tags:

powerbi

dax

Is there a way to differentiate between a blank value in a column and a 0 value in a column, when I tested with an if statement they were treated as the same value... any suggestions?

like image 330
beastlyCoder Avatar asked Dec 02 '25 09:12

beastlyCoder


2 Answers

Yes, there is. In a calculated column, first test a value for being blank, then test for beign zero:

enter image description here

So, create a flag and filter your sum measure by it, i.e,

No blanks sum = CALCULATE( SUM(Table[Amount]), Test <> "Blank")
like image 184
RADO Avatar answered Dec 06 '25 12:12

RADO


Not really. You see, the SUM function in DAX sends a SUM function to SQL, and that converts the NULL values or Blank to 0. That's because DAX is intended to work on Totals (or calculated columns) not on the cell's value . So what you want to do is check out the different versions of each function (or set) to grab only the non-empty values. Of course there are workarounds, but this is the fundamental issue. What can you do?

Check if the value is blank function: IS BLANK
Marco Russo explains things much better
Or maybe this link will help?

like image 22
Hila DG Avatar answered Dec 06 '25 12:12

Hila DG



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!