4 Replies Latest reply: Feb 21, 2018 2:59 PM by Aaron Bishop RSS

    Calculation within Set Analysis

    Aaron Bishop

      Hello All,

       

      First Problem:

       

      I need to add all values in my [Total Leads] field that fall within the month of the last date given. The max([Date]) will change based on restrictions applied in the load script. I started with If() statements, but they are not as flexible and do not allow a max() aggregation.

       

      What I need, then, is something similar to one of these functions:

       

      Sum({$<Month([Date])={"$(=Month(Max([Date])))"}>}[Total Leads])

       

      Sum({$<[Date]={"$(>=MonthStart(Max([Date])))"}>*$<Date={"$(<=MonthEnd(Max([Date])))"}>}[Total Leads])

       

       

      Second Problem:

       

      I need to restrict the dimension of a graph in a similar manner. The dimension would be [Date.autoCalendar.Date], but I only want it to show dates for the month of the last date available (max([Date])). Again, I started with If(), but this does not allow the max(). Any work-arounds?

       

      As always, thank you for the help.

       

      Aaron