Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Showing Only Max Avg Value on TTM Graph

Hi,   I have a TTM graph that has 4 lines based on measures.  I was able to create measures to show the last month's values as data labels on my graph, but also want to show Max and Min values.  My...
  • amitchandak's avatar
    3 years ago

    Anonymous , max date would be like

     

    Cred Max CPF =
    VAR _SelDate =
    MaxX(allselected('Date'), 'Date'[Date])
    VAR Result =
    Calculate(Calculate(MAX('CPF Average'[Avg]),Map_Product[Reporting Product]="Cred",'Cost Per File'[EOM]>=_PV13&&'Cost Per File'[EOM]<=_PV13,
    USERELATIONSHIP('Date'[Date],'Disconnect Date'[Date])), filter( 'Date', 'Date'[Date] =_SelDate))
    Return
    Result

     

     

    and min will be

     

    Min Date = eomonth([Cred Max CPF],13)+1  //in case you need date before 13 months

  • Anonymous's avatar
    Anonymous
    3 years ago

    amitchandak    My actual solution was this:

    Var _SelDate=SELECTEDVALUE('Date'[Date])
    Var _enddate=EOMONTH(_SelDate,-13)
    VAR _maxcpf=calculate(max('CPF Average'[Avg]),All('CPF Average'[EOM]),DATESBETWEEN('Date'[Date],_enddate,_SelDate),'CPF Average'[Reporting Product]="Cred")
    Return
    If([Cred TTM Avg CPF]=_maxcpf,_maxcpf,Blank())