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
scsos
New Member

max and min value from group

So I figured how to group values but now I'm trying to get max and min of those values for every person.

 

I've worked out how to group and get max but then I end up with just the max and all the other values are gone, when I want to get the min for each person too.  How to do that?

 

scsos_0-1763711884568.png

 

2 ACCEPTED SOLUTIONS
PhilipTreacy
Super User
Super User

@scsos 

 

Download example PBIX file with the code below

 

I’m not 100% sure I know what you mean but if you are asking to get both the max and min value for each person and end up with just 1 row per person and a column each for max and min, like this

 

PhilipTreacy_0-1763722432206.png

 

Then you can do it this way.

 

First, group by Person and for the Operation choose All rows

 

PhilipTreacy_1-1763722460369.png

PhilipTreacy_2-1763722472223.png

 

Giving this

 

PhilipTreacy_3-1763722500327.png

 

You can access the values inside the tables by using this code, create a new Custom Column

 

= List.Min([All][Amount])

 

Likewise to get the max use List.Max

 

= List.Max([All][Amount])

 

You can delete the column with the Tables to give the result

 

PhilipTreacy_4-1763722569787.png

 

Regards

 

Phil

 

 

 

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

ronrsnfld
Super User
Super User

In the Group By dialog, select Advanced Mode and add the Min aggregation:

ronrsnfld_0-1763729061814.png

 

 

View solution in original post

2 REPLIES 2
ronrsnfld
Super User
Super User

In the Group By dialog, select Advanced Mode and add the Min aggregation:

ronrsnfld_0-1763729061814.png

 

 

PhilipTreacy
Super User
Super User

@scsos 

 

Download example PBIX file with the code below

 

I’m not 100% sure I know what you mean but if you are asking to get both the max and min value for each person and end up with just 1 row per person and a column each for max and min, like this

 

PhilipTreacy_0-1763722432206.png

 

Then you can do it this way.

 

First, group by Person and for the Operation choose All rows

 

PhilipTreacy_1-1763722460369.png

PhilipTreacy_2-1763722472223.png

 

Giving this

 

PhilipTreacy_3-1763722500327.png

 

You can access the values inside the tables by using this code, create a new Custom Column

 

= List.Min([All][Amount])

 

Likewise to get the max use List.Max

 

= List.Max([All][Amount])

 

You can delete the column with the Tables to give the result

 

PhilipTreacy_4-1763722569787.png

 

Regards

 

Phil

 

 

 

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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