Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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])
Hi,
Does this measure work?
All time max = MAXX(ALL(_Calendar[Month_year]),[SalesValue])
Hi @Anonymous ,
@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])
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.
@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))
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 37 | |
| 36 | |
| 32 | |
| 31 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 86 | |
| 85 | |
| 68 | |
| 64 |