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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors