4 Replies Latest reply: Mar 30, 2016 8:48 AM by Brent Driggers RSS

    Set Analysis - Month Comparison

    Brent Driggers

      I have a line chart that I'm comparing previous years with the current year.  I only want to show the past months for the current year.  How do I do this?


      I have variables for the current date:

      LET vToday = (today(1));

      LET vCurrentMonth = Month(today(1));

      LET vCurrentYear = Year(today(1));


      In loading data I have:

      Month([SH_ShipDate]) as MonthTxt,

      Date(YearStart([SH_ShipDate]), 'YYYY') as Year;


      Set Analysis:

      Sum({1<[Year]={$(=vCurrentYear)}, [MonthTxt]={"<$(=Num(vCurrentMonth))"}>}[CALC_Sales])


      This is showing all months in the current year with zero for those months in the future.