Default behavior of Power BI is to show (Blank) when there is nothing, even when summing a numerical column that happens to be all empty. But what if you want to show 0 instead? Well, with COALESCE you can.
In this simple example I have a table showing sales per region for a company that is not doing so good – they are not selling anything.
Assuming SalesAmount is a numerical column, if you make a visual with this you get:
Business users might just want to see 0 in this case, not the (more correct) (Blank). To make this happen, add a simple measure:
The way this works is that the COALESCE function will just return the first thing it finds reading from left to write in the parameter list that is not null/blank. That happens to be 0. If for whatever reason you wanted to show -1 when there are no sales, you can do that as well, just change the 0 to -1.
Enjoy and don’t forget to feel good about making your business users happy 🙂