Welcome to the community @machneit
Defining variables seems to only be available at dashboard level at the moment. See post bellow with a workaround for that. Hope it helps!
Docs for creating dashboard variables here.