How to Use the Power BI DAX function VAR.S

Syntax of VAR.S Function

The syntax of the VAR.S function is as follows:



- `❰expression1❱,❰expression2❱,...` are numeric expressions for which you want to calculate the variance.

Example of VAR.S Function

Let's say we have a table named "Sales" with two columns: "Region" and "SalesAmount". We want to calculate the variance of the sales amount for each region. Here's how we can use the VAR.S function to achieve this:

VAR RegionSalesVariance =

VAR SalesAmounts =




In the above example, we first define a variable named "SalesAmounts" that contains all the distinct sales amounts from the "Sales" table. We then use the VAR.S function to calculate the variance of the sales amounts in the "SalesAmounts" variable. Finally, we assign the result to another variable named "RegionSalesVariance". This variable will contain the variance of the sales amounts for each region.

In conclusion, the VAR.S function in Power BI DAX is a powerful tool for calculating variance based on a sample of data. By using this function, you can quickly calculate the variance of numeric expressions in your data. So, if you want to perform variance analysis in your Power BI project, be sure to incorporate the VAR.S function in your DAX formulas.

Power BI DAX Training Courses by G Com Solutions (0800 998 9248)

Upcoming Courses

Contact Us


    Your Name (required)


    Email (required)


    Training Course(s)

    Your Message

    Upload Example Document(s) (Zip multiple files)