Variables, data types, constants …

Variables are placeholders within computer memory that are aimed to store values ​​of different types of data, such as: numbers, text, logical values, date/time … Although this is not necessary, for better memory utilization, you need to declare them at the beginning of the program and assign them a data type. Variables that will have fixed values ​​during program execution are called constants.

DAX variables

When you write DAX expressions it is a general recommendation not to overestimate their complexity. It is always better to create several measures and further consolidate them within the new formula. The code is more transparent, and there is a lot less chance to make an error. Since recently DAX also allows making variables. They are used to create measures that will be used to create an expression that returns final result.