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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
DennisReynolds
New Member

Chart to show min/max values and current value

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!!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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

vpollymsft_0-1671676819022.png

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.

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

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"?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

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

vpollymsft_0-1671676819022.png

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.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors