Forum Discussion

romoguy15's avatar
romoguy15
Helper IV
4 years ago
Solved

YTD Total Minus Current Week

Good Morning, I am trying to calculate a YTD total that excludes the current fiscal week I am in because current week is incomplete. For example, we are in week 39. But I only want to see the YTD to...
  • v-yalanwu-msft's avatar
    4 years ago

    Hi, romoguy15 ;

    You could try it.

    YTD Total2 = 
    var _todayweek=MAXX(FILTER(ALL('Calendar'),[Date]=TODAY()),[Fiscal Week])
    return CALCULATE([Total Tickets],FILTER(ALL('Calendar'),[Year]=YEAR(TODAY())&&[Fiscal Week]<_todayweek))

    The final output is shown below:

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • v-yalanwu-msft's avatar
    4 years ago

    Hi, romoguy15 ;

    Do you mean the sum of weeks 1-38 in 2020 and weeks 1-38 in 2021? Ps: Now that it's been another week, that's 39 weeks. If so, try the following formula:

    Total Tickets = 
    var _todayweek=MAXX(FILTER(ALL('Calendar'),[Date]=TODAY()),[Fiscal Week])
    return CALCULATE( COUNT(HVAC[Ticket Id]),FILTER('Calendar',[Fiscal Week]<_todayweek))

    The final output is shown below:

    Best Regards,
    Community Support Team_ Yalan Wu