5 Replies Latest reply: Aug 23, 2018 10:17 AM by Felipe Andrade RSS

    Max of date help

    Mahitha M

      Hi Experts,


      Can any  one please help me on below requirement.

      In the below its showing two dates(19.08.2018 and 18.08.2018) sum of amount.

      Could you please help me to show the Max([Reporting Date]) i.e., 19.08.2018 amount by default then after selecting 18.08.2018 it has to show selected date amount.


      The measure used here is below one. I have to apply [Reporting Date]=$(=Max( [Reporting Date]))



      Sum(Aggr(RangeMax(0,Sum(Value)) + RangeMax(Sum(Item1),Sum(Item2),Sum(Item3),Sum(Item4),Sum(Item5),Sum(Item6),Sum(Item7),Sum(Item8),Sum(Item9),Sum(Item10),Sum(Item11))/5+0.1, Date, Name, SCOPE))/
      Sum(TOTAL <Name> {<SCOPE>} Aggr(RangeMax(0,Sum({<SCOPE>}Value)) + RangeMax(Sum({<SCOPE>}Item1),Sum({<SCOPE>}Item2),Sum({<SCOPE>}Item3),Sum({<SCOPE>}Item4),Sum({<SCOPE>}Item5),Sum({<SCOPE>}Item6),Sum({<SCOPE>}Item7),Sum({<SCOPE>}Item8),Sum({<SCOPE>}Item9),Sum({<SCOPE>}Item10),Sum({<SCOPE>}Item11))/5+0.1, Date, Name, SCOPE))



      max of date.png



      Please help me on this. Please find the attached app.

      Thanks in advance.

        • Re: Max of date help
          Marina Dor

          Hi Mahitha,


          Experts will have difficulties to help you like this I think. Since you are aggregating in your measure, you have to know excatly what result you should obtain, and then think.

          The idea is to add a set analysis like {<[Reporting Date]={'$(=Max( [Reporting Date]))'}>}, but only you can know where, depending on what result you want.




          • Re: Max of date help
            Valeria Astapenko


            mb i don not understand you correct and you requirements...

            Mb you need something like this:


            if (getselectedcount ( ReportingDate)>0, Sum(Amount), Sum( {<[Reporting Date]={'$(=Max( [Reporting Date]))'}>}Amount))

            • Re: Max of date help
              praveen kumar

              Try like this





              ,Sum({< ReportingDate = {'$(=Max(ReportingDate))'} >} Amount ))


              May be Helpful....





                • Re: Max of date help
                  Mahitha M

                  Hi Praveen,


                  Without selecting any date I have to apply Max of date in the below expression.


                  Sum(Aggr(RangeMax(0,Sum(Value)) + RangeMax(Sum(Item1),Sum(Item2),


                  [Reporting Date],Date, Name, SCOPE))


                  Sum(TOTAL <Name, [Reporting Date]> {<SCOPE>} Aggr(RangeMax(0,Sum({<SCOPE>}Value)) +



                  Sum({<SCOPE>}Item10),Sum({<SCOPE>}Item11))/5+0.1, Date, Name, SCOPE, [Reporting Date]))

                • Re: Max of date help
                  Felipe Andrade

                  if you do Max(Date) it will return your last date. and it will also return the last date filtered if you select two. and the actual date selected if it is only one.


                  when doing this:

                  [Reporting Date]=$(=Max( [Reporting Date]))

                  you can make it work like this:

                  [Reporting Date]="Max( [Reporting Date])"     // if it is a filter

                  [Reporting Date]=Max( [Reporting Date])        // in a if statement


                  double quotes calculate the content, single quotes uses it as string.


                  I think with this you can work your function out.


                  Like, mark as helpful or as the answer. It helps a lot!