Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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])

 

 


jf74l0x4sgt61.png

 

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Does this measure work?

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


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-luwang-msft
Community Support
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
amitchandak
Super User
Super User

@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])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
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.

Jsaunders09_1-1618575999326.png

 

 

@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))

 

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.