• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

MIN/MAX Function equivalent in pq?|Power Query|Excel Forum|My Online Training Hub

You are here: Home / MIN/MAX Function equivalent in pq?|Power Query|Excel Forum|My Online Training Hub

vba course banner

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower QueryMIN/MAX Function equivalent in pq?
sp_PrintTopic sp_TopicIcon
MIN/MAX Function equivalent in pq?
Avatar
Matthias
Member
Members
Level 0
Forum Posts: 48
Member Since:
December 13, 2017
sp_UserOfflineSmall Offline
1
January 22, 2018 - 6:06 am
sp_Permalink sp_Print

Hello, is there a kind of Max or Min function in powerquery to compare the values of different columns? I want to add a custom column which gives for each line the max value of other (existing) columns.

=> something like Max([ColumnX],[ColumnY],[ColumnZ])

sp_AnswersTopicSeeAnswer See Answer
Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4515
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
January 22, 2018 - 1:56 pm
sp_Permalink sp_Print

Hi Matthias,

Select the 3 columns you want to derive the max and min from > Add Column tab > Statistics > Max. Repeat for Min column.

Note: this will compare the 3 values per row and return the max/min for that row, not the max/min for the whole column.

Mynda

sp_AnswersTopicAnswer
Answers Post
Avatar
Matthias
Member
Members
Level 0
Forum Posts: 48
Member Since:
December 13, 2017
sp_UserOfflineSmall Offline
3
January 23, 2018 - 7:08 am
sp_Permalink sp_Print

Thanks, Mynda! That helped a lot, with this info I could use List.Max exactly how I needed it.

Thanks again,
Matthias

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4515
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
4
January 23, 2018 - 12:15 pm
sp_Permalink sp_Print

Great! Glad it was what you were after.

Avatar
Abdollah Baladi

New Member
Members
Level 0
Forum Posts: 1
Member Since:
February 10, 2019
sp_UserOfflineSmall Offline
5
February 10, 2019 - 7:32 pm
sp_Permalink sp_Print

Hello, is there a kind of Max or Min function in powerquery to compare the values of One columns? I want to add a custom column which gives for each line the max value of other (existing) columns.

=> something like Max([ColumnX])

Avatar
Jane Joyce

New Member
Members
Level 0
Forum Posts: 1
Member Since:
March 18, 2020
sp_UserOfflineSmall Offline
6
March 18, 2020 - 5:14 am
sp_Permalink sp_Print

Hi there,

Is there a way to do the same with Dates?  When I tried the above with Dates, the Min/Max is greyed out (unavailable).

I want to find the Min and Max per position number in Power Query for the following example:

Position #   Begin Date   End Date           Min Date     Max Date

12345         1/10/10       1/10/13             1/10/10       31/12/99

12345         2/10/13       2/10/15             1/10/10       31/12/99

12345         3/10/15       31/12/99           1/10/10       31/12/99

67890         1/3/16         1/4/18               1/3/16        31/12/99

67890         2/4/18         1/4/19               1/3/16        31/12/99

67890         2/4/19         31/12/99            1/3/16        31/12/99

 

Look forward to hearing from you.

🙂

Avatar
Chris Yap
Member
Members
Level 0
Forum Posts: 162
Member Since:
August 21, 2019
sp_UserOfflineSmall Offline
7
March 20, 2020 - 4:15 pm
sp_Permalink sp_Print

Hi Jane Joyce

Not sure this is what you want

Unpivot > Group by > aggregate so that you can find min of a list of dates (Col 1..... Col x)

You maximum always "31/12/9999" ? 

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Rashid Khan
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 216
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Melanie Ford
Isaac Felbah
Adele Glover
Hitesh Asrani
Rohan Abraham
Anthony van Riessen
Erlinda Eloriaga
Abisola Ogundele
MARTYN STERRY
Rahim Lakhani
Forum Stats:
Groups: 3
Forums: 24
Topics: 6356
Posts: 27793

 

Member Stats:
Guest Posters: 49
Members: 32324
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.

Download A Free Copy of 100 Excel Tips & Tricks

excel tips and tricks ebook

We respect your privacy. We won’t spam you.

x