PowerBI Differentiate BLANK value and 0 value

…衆ロ難τιáo~ 提交于 2021-01-27 21:28:23

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!