Forum Discussion

Philip-K's avatar
Philip-K
Frequent Visitor
9 years ago
Solved

Printing 0-values with summarize

I use one large data file in which all incidents are reported. Both the incident and the impact of the incident is reported in this source file. To calculate the moving average over several months, I...
  • Philip-K's avatar
    Philip-K
    9 years ago

    Hi,

     

    I recently figured out how to solve the problem I was having. If I break it down, the real problem was that I wanted the table I create (as a summary of all the data in the master data file) did not show the months in which no data was recorded. So what I did is the following:

    I created a static table with all the YearMonth combinations for the forseeable future and recorded past. (i.e. 2013-01 untill 2050-12)

     

    Then I created a new calulated table with the DAX: Distinct(YearMonth) to print every individual value into this table.

     

    Following I created an IF calculation on the SUM (and separately COUNT) of the incidentents in the following way:

    IF(CALCULATE(SUM(<incidents>);<filters>)=blank();0;

    CALCULATE(SUM(<incidents>);<filters>))

     

    It works perfectly in this situation. Because this situation called for a moving average calculation over several fillers on data, I couldn't find a way to use the measure functionality. I would love to see the moving average be a feature in the visualization level in some future release. My opinion on the matter is that this should be Chart-functionality, not something I need to calculate myself.