Maven profile equivalent in Gradle

My application landscape consists of several domains with dozens of projects (Maven modules) which can be turned on or off via simple mouse clicks in IntelliJ IDEA.
This is how these modules are defined via profiles in Maven:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi=""

Such a profile/module can then easily be activated via a checkbox in IDEA:

How can this be achieved with Gradle also in IDEA? I haven’t found a profile-equivalent in Gradle yet, using if/else in the build script is cumbersome and there is no UI support for such custom steps.