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
Jond
Regular Visitor

Obtain maximum value (envelope)

Hello,

 

I have some data visualized in Power Bi using R scripts (ggplot2 library). Field data (two variables, y as a function of x, black points) and two constant theoretical curves (red).

Data from several daysData from several days

In order to compare the field data with the theoretical curves, I would like to obtain the maximum and minimum y values per x value per day. For example:

Day 1Day 1

Day 2Day 2

The objective is to obtain "envelope" curves, get rid of the rest of data and compare them in one visual respect to the theoretical curves. 

 

Any ideas? How can I obtain the values in R script or in the query?

 

Thanks

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@Jond ,

 

I think you can use dax instead, could you share the sample data and the output result?

 

Regards,

Jimmy Tao

I share some sample data (raw and sample report):

 

https://www.dropbox.com/sh/6lxcf9dj4v0yjoa/AAB8ClxYanQ70P5f73uwxbtga?dl=0

 

This should be the output result:

Output (2).png

 

For each x value, the maximum and the minimum of y are stored and the rest of the data is discarded. The figure shows the maximum and the minimum values of y for a range of x. Each color is a different day.

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.