Forum Discussion

Jouni900's avatar
Jouni900
Frequent Visitor
3 years ago
Solved

YTD for Average

Hi,

 

I have a target on a monthly level for which I would want to calculate YTD. My source data is on a daily level so in order to get correct monthly target, I have taken AVERAGE from the target value. The problem however comes when I would like to get YTD, let's say on a two month period in the example below, 110.

 

I have calculated the target which works for an individual month using the formula below

Category FCST = CALCULATE(AVERAGE('SKU Daily Data 2021-2022 - ÄLÄ'[Category FCST]))

 

How I would be able to extend the YTD for multiple periods?    

 

MonthDateTarget
112350
1123450
11234550
223460
2234560
2234660

  

  • Hi Jouni900 

     

    If I understand it correctly, you can try the following measure for the monthly YTD. It sumx your [Category FCST] measure. 

    YTD =
    SUMX (
        FILTER (
            ALL ( 'SKU Daily Data 2021-2022 - ÄLÄ'[Month] ),
            'SKU Daily Data 2021-2022 - ÄLÄ'[Month]
                <= MAX ( 'SKU Daily Data 2021-2022 - ÄLÄ'[Month] )
        ),
        [Category FCST]
    )
    

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

2 Replies

  • v-jingzhang's avatar
    v-jingzhang
    Icon for Community Support rankCommunity Support

    Hi Jouni900 

     

    If I understand it correctly, you can try the following measure for the monthly YTD. It sumx your [Category FCST] measure. 

    YTD =
    SUMX (
        FILTER (
            ALL ( 'SKU Daily Data 2021-2022 - ÄLÄ'[Month] ),
            'SKU Daily Data 2021-2022 - ÄLÄ'[Month]
                <= MAX ( 'SKU Daily Data 2021-2022 - ÄLÄ'[Month] )
        ),
        [Category FCST]
    )
    

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.