cancel
Showing results for
Did you mean:
Highlighted
Anonymous
Not applicable

## How to create variance field and variance %

Hello all,

i'm beginner and just want to know how i can create the variance of column 1 and 2 and also the variance %

the numbers 1 until 5 represent columname MONTH and the products represent columnname PRODUCT.

Kind regards,

Rega

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support

Hi @Anonymous,

You can create measures below:

Variance = CALCULATE(SUM(Table1[Amount]),FILTER(Table1,'Table1'[Month]=1))-CALCULATE(SUM(Table1[Amount]),FILTER(Table1,'Table1'[Month]=2))

Variance % = DIVIDE('Table1'[Variance],CALCULATE(SUM(Table1[Amount]),FILTER(ALL(Table1),'Table1'[Month]=1)))

By the way, I would suggest you display those two measures in card visuals. As you use matrix visual to display data originally, if we add two measures to this matrix, two measures values will display under each column group, means under 1, 2,...,5, each will have three columns. It will make the matrix messy, as you just want to return variance between the 1 and 2.

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 REPLIES 6
Highlighted
Super User IV

Do you mean like:

```Variance = [1] - [2]

Variance% = ([1] - [2]) / [1]```

---------------------------------------

##### I have a NEW book! DAX Cookbook from Packt
Over 120 DAX Recipes!

Proud to be a Super User!

Highlighted
Community Support

Hi @Anonymous,

You can create measures below:

Variance = CALCULATE(SUM(Table1[Amount]),FILTER(Table1,'Table1'[Month]=1))-CALCULATE(SUM(Table1[Amount]),FILTER(Table1,'Table1'[Month]=2))

Variance % = DIVIDE('Table1'[Variance],CALCULATE(SUM(Table1[Amount]),FILTER(ALL(Table1),'Table1'[Month]=1)))

By the way, I would suggest you display those two measures in card visuals. As you use matrix visual to display data originally, if we add two measures to this matrix, two measures values will display under each column group, means under 1, 2,...,5, each will have three columns. It will make the matrix messy, as you just want to return variance between the 1 and 2.

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

indeed!

Highlighted
Anonymous
Not applicable

Thanks for your advise. But what if want to have measures which calculate the variance and variance % between month 2 and 3 or 4 and 5 ? So to have a flexible measurements?

Highlighted
Helper V

Have a look at our Variance and Waterfall Chart:

https://dataviz.boutique/

Highlighted
Frequent Visitor

How did you get the Table reference to work? I can't find table names or anything similar to that using the current PowerBI Desktop.

Announcements

#### Power Platform Community Conference

Check out the on demand sessions that are available now!

#### Microsoft Power Platform Communities

Check out the Winners!

#### Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors