Skip to main content

How to Get the Smallest Value in Power Apps with Min

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

Min returns the smallest of its numbers. Besides finding the lowest value in a list, it's the simplest way to give a control a maximum size: "as wide as the screen allows, but never wider than 640 pixels".

Syntax​

General form
Min( NumericalFormula1, [ NumericalFormula2, ... ] )
Min( Table, NumericalFormula )

From Microsoft's aggregate functions reference:

  • NumericalFormula1, NumericalFormula2, ...: the numbers to compare. The first is required.
  • Table and NumericalFormula: a table, and a formula worked out for each of its records, often a column. Min returns the smallest result.
  • The result is the smallest number. The reference adds that these functions operate on numeric values only, and that other types of values, such as text, are ignored.

Max works the same way for the largest value (How to Get the Largest Value in Power Apps with Max).

The example is the Reports screen of the Overtime Timesheet app. Its list of people, the gallery galPeopleRS, sits in a vertical container. On a laptop, cards as wide as the screen would be hard to read; on a phone, they should use the whole width.

Step 1: Write the Width​

Select the gallery, choose Width in the property list, and enter:

galPeopleRS → Width
Min(640, Parent.Width - 48)
  • 640 is the widest the gallery may be.
  • Parent.Width - 48 is the width of the container the gallery is in, less 48 pixels of margin (How to Use Self and Parent in Power Apps).
  • Min takes whichever is smaller.

Step 2: Check the Result on a Wide Screen​

Select the formula bar to see what the formula returns (How to See What a Formula Returns in Power Apps Studio). At Studio's default size, 1366 by 768, the container is wider than 688 pixels, so Min returns 640:

The formula bar with the Width property selected and Min(640, Parent.Width - 48), and the preview strip under it reading Min(640, Parent.Width - 48) = 640 with Data type number

Step 3: Check It on a Small Screen​

Studio's status bar, under the canvas, has buttons that show the screen at other sizes; they don't change the app. With Small 600x768 selected, the same formula returns 536, the container's width less 48:

The same formula bar with the preview strip reading Min(640, Parent.Width - 48) = 536 with Data type number, at the Small 600x768 size

Select Default 1366x768 again when you've checked.

The Result​

In the app on a laptop, the cards stop at 640 pixels, on the left under the chart:

The Reports screen for November 2026 on a laptop, with four person cards in a column 640 pixels wide on the left of the screen

On a phone, they fill the width, less the margins:

The Reports screen at phone width, with the person cards as wide as the screen less a small margin on each side

Common Mistakes​

MistakeWhat happensDo this instead
Max for a maximum widthThe control is never narrower than the limit, even on a phoneMin for an upper limit
Parent.Width without a marginThe control touches both edges of its containerSubtract the margins
Text numbers, such as "640"The reference says other types are ignoredUse numbers, or convert with Value
Min over a large SharePoint list without checkingOnly the rows downloaded may be countedCheck the delegation warning

Troubleshooting​

SymptomLikely causeFix
The width is always 640Studio is showing its default sizeCheck at a small size, or on a phone
The control is wider than the screen on a phoneThe width is a fixed numberMin(<limit>, Parent.Width - <margins>)
A delegation warning on MinThe table is a data source that can't do it on the serverSee Microsoft's delegation notes for the source

FAQ​

Can Min take more than two numbers?​

Yes: Min(a, b, c, ...) returns the smallest of them all.

What's the table form for?​

The smallest value in a column, such as the shortest shift: Min(Entries, Hours) works out Hours for each record and returns the smallest.

Should I set a minimum width too?​

Max(<minimum>, Min(<maximum>, Parent.Width - 48)) keeps the width between the two. The example has no minimum.

Conclusion​

Min(a, b) returns the smaller number, so Min(640, Parent.Width - 48) makes a control as wide as its container allows, up to 640 pixels. The formula bar's preview strip, at Studio's sizes, shows both cases before you run the app.

Additional Resources​