Luke Walker on 11 Aug 2018 00:21:42
Often in reports, it is convenient and simplifies content to display zeroes as blanks. Current the DAX VAR Print = 'code here' RETURN IF(Print=0,BLANK () ,Print). This could be simplified by a function ZEROTOBLANK () or similar to replace this.
- Comments (2)
RE: Change Zero to Blank Function
If you want slightly shorter code in the meantime to convert zeros to blanks, you can use:
DIVIDE(1,DIVIDE(1,'code here'))
Of course, this code is probably slower than yours and is not as clear.
To convert blanks to zeros, use this:
'code here'+0
Instead of having a special BLANKTOZERO function, I feel that it is best to introduce IFBLANK and use 0 as the 2nd argument:
https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/32049442-add-function-ifblank-value-alternate
RE: Change Zero to Blank Function
this is a nice feature to have. I would recommend to have both options, 1) show all zeros to blanks 2) all blanks as zeros. Also, would be super useful to provide this option in the Format blade.