Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Displaying All Time Max

I am trying to write a measure to display the max sales of all time like the below example chart.

 

Assuming each column is sales for the month but in July 2020 sales was $7.5m, I would like the orange line to represent $7.5m.

 

I have the below measure that returns the correct value when used on a card visual but doesn't like being added to a chart, any suggestions for an alternate measure?

 

 

SalesRecord = 
var _tbl = SUMMARIZECOLUMNS(_Calendar[Month],"Total",[SalesValue])
RETURN MAXX(_tbl,[Total])

 

 


 

5 Replies

  • Anonymous , date or month ?

    Try these measures

     

    maxx(Values(Calendar[Month-year]), [SalesValue]) //Date or month ??

    or

     

    maxx(Values(Calendar[Date]), [SalesValue])

    or

     

    SalesRecord =
    var _tbl = summarize(_Calendar[Date],"Total",[SalesValue])
    RETURN MAXX(_tbl,[Total])

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the reply amitchandak 

      To answer your question, Month not Date - I have updated my post to be clear.

      Your suggestions return a chart that looks like the below.

       

       

      • amitchandak's avatar
        amitchandak
        Super User

        Anonymous , I think I forget to add allselected or all

         

        calculate( maxx(Values(Calendar[Month-year]), [SalesValue]) , allselected (sales)) //assumes table as sales , ot use all if needed

        or

         

        calculate(maxx(Values(Calendar[Date]), [SalesValue]), allselected (sales))

         

         

         

  • v-luwang-msft's avatar
    v-luwang-msft
    Community Support

    Hi Anonymous ,

    Has your problem been solved, if so, please consider Accept a correct reply as the solution to help others find it.
     
    Best Regards
    Lucien
  • Hi,

    Does this measure work?

    All time max = MAXX(ALL(_Calendar[Month_year]),[SalesValue])