Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 years ago
Solved

Moving Average in Matrix visual

Hi Everyone, How do I make a moving average per Cycle (each 15 days in the month) and Channel with the Matrix visual. So, for the Channel E-COMMERCE, in the cycle 332, my average is (4 + 6)/2. In ...
  • Anonymous's avatar
    Anonymous
    10 years ago

    v-haibl-msft, sincere thanks. I coudn't download the file, maybe because of the Company's firewall.

     

    The dataset example was not good. I missed to say that one Store sells products between cycles and each Store has a Channel. The average was counting the number of rows by Channel.

    It was my fault to understand how the values are aggregated.

    I changed the Dax to:

     

     

    Moving Avg = 
    CALCULATE (
        DIVIDE((sum(Plan1[VALUE]));DISTINCTCOUNT(Plan1[CYCLE]));
        FILTER (ALLSELECTED(Plan1); Plan1[CYCLE] <= MAX (Plan1[CYCLE]));
    	VALUES(Plan1[CHANNEL])
    )

    Now everything is fine.

     

    Thank you again.