Dynamic positioning in Canvas Apps (Power Apps) is the practice of using formulas to set a control’s X, Y, Width, and Height properties instead of relying on hardcoded numbers. This ensures your app looks great and functions correctly across different screen sizes, orientations, and devices.

The core principle is making a control's properties relative to its Parent (the screen or container it sits in), the App itself, or other controls.

Here is a breakdown of how to master dynamic positioning.


1. Positioning Relative to the Parent (Containers or Screens)

Using Parent.Width and Parent.Height is the most common way to dynamically position elements.

Centering a Control

  • Center Horizontally (X property):

            (Parent.Width - Self.Width) / 2

  • Center Vertically (Y property):

            (Parent.Height - Self.Height) / 2

Aligning to Edges

  • Align Right (X property):

            Parent.Width - Self.Width

  • Align Bottom (Y property)

            Parent.Height - Self.Height

Spanning the Full Parent

  • Width: Parent.Width
  • Height: Parent.Height


2. Positioning Relative to Other Controls

You can make a control's position react dynamically to another control on the screen. This is incredibly useful for building forms or navigation bars where elements need to stack neatly without overlapping.

Assume you have a label named lblHeader.

    Place directly below the header (Y property):

  • lblHeader.Y + lblHeader.Height + 10 (The +10 acts as padding)

    Place directly to the right of the header (X property):

  • lblHeader.X + lblHeader.Width + 10