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
Hi,
I am trying to create a chart that will show the min/max stock prices for a given date range as well as a point for the most recent stock price. Sort of like a gauge chart. Ideally the range would be represented by a horizontal line with each end representing the min and max values. And the most current price would be a point on that line to show how close/far the current price is to its historical max/min. Thank you!!
Solved! Go to Solution.
Hi @DennisReynolds ,
Please refer to my pbix file to see if it helps you.
Create a measure.
Measure = var _max=MAXX(ALLSELECTED('Table'[date]),'Table'[date])
var _min=MINX(ALLSELECTED('Table'[date]),'Table'[date])
var _maxvalue=CALCULATE(MAX('Table'[value]),FILTER(ALL('Table'),'Table'[date]<=_max&&'Table'[date]>=_min))
var _minvalue=CALCULATE(min('Table'[value]),FILTER(ALL('Table'),'Table'[date]<=_max&&'Table'[date]>=_min))
var _newest=CALCULATE(MAX('Table'[value]),FILTER(ALL('Table'),'Table'[date]=_max))
return
IF(MAX('Table'[value])=_maxvalue,MAX('Table'[value]),IF(MAX('Table'[value])=_minvalue,MAX('Table'[value]),IF(MAX('Table'[value])=_newest,MAX('Table'[value]),BLANK())))
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Share some data (in a format that can be pasted in an MS Excel file) and show the expected result. If you are selecting a date range, then what do you mean by "most current price"?
Hi @DennisReynolds ,
Please refer to my pbix file to see if it helps you.
Create a measure.
Measure = var _max=MAXX(ALLSELECTED('Table'[date]),'Table'[date])
var _min=MINX(ALLSELECTED('Table'[date]),'Table'[date])
var _maxvalue=CALCULATE(MAX('Table'[value]),FILTER(ALL('Table'),'Table'[date]<=_max&&'Table'[date]>=_min))
var _minvalue=CALCULATE(min('Table'[value]),FILTER(ALL('Table'),'Table'[date]<=_max&&'Table'[date]>=_min))
var _newest=CALCULATE(MAX('Table'[value]),FILTER(ALL('Table'),'Table'[date]=_max))
return
IF(MAX('Table'[value])=_maxvalue,MAX('Table'[value]),IF(MAX('Table'[value])=_minvalue,MAX('Table'[value]),IF(MAX('Table'[value])=_newest,MAX('Table'[value]),BLANK())))
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |