问题
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?
回答1:
Yes, there is. In a calculated column, first test a value for being blank, then test for beign zero:
So, create a flag and filter your sum measure by it, i.e,
No blanks sum = CALCULATE( SUM(Table[Amount]), Test <> "Blank")
回答2:
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?
来源:https://stackoverflow.com/questions/51756571/powerbi-differentiate-blank-value-and-0-value