Forum Discussion

wjkolesar's avatar
wjkolesar
Icon for Advocate II rankAdvocate II
7 years ago
Solved

Adding + 0 on Measure Directly Impacts Performance - Memory Issues

Hi -  I have a measure where I want to display 0 instead of (Blank) in the KPI visual.  I can achieve this by adding "+ 0" onto the end of my measure calculation.  However, whenever I try to place t...
  • d_gosbell's avatar
    7 years ago

    Adding any constant value to a measure result can cause serious performance and memory issues. The reason for this is that the DAX engine is really good at eliminating blank values, but by adding 0 you've made this measure always return a non blank value.

     

    Suppose you had a customer table with 10,000 customers and a product table with 1,000 products. If your customers only purchase 3-4 times a year and only buy 2-3 products at a time you could create a table of last months sales and expect maybe 3000 customers and 3 products each so 9,000 rows.

     

    BUT if you add a +0 onto the sales amount, now every possible combination of customer and product will return a value so you will get 1,000,000 rows back. And this simple example is just with 2 columns. If you add in the dates (assuming we are filtered to just 1 month) we now have around 30 million rows that the query engine has to process and materialize.

     

    So you either want to be a lot more selective about when you return 0 or maybe create a separate measure for your KPI that is not used elsewhere.