cancel
Showing results for
Did you mean:
Highlighted
Regular Visitor

## Variance Minus 1 month

Hello, I'm a beginner DAX/Power Bi and am stuck as to why my logic does not work or what the correct logic should be. I'm trying to find the variance (and then percentage of variance) from month to month of a dynamic 3 month average. Bascially did the average go up or down from the previous month by how much and what percent.

Here is what I have so far:

```Variance = CALCULATE(SUM('ARTransactiontbl'[Positive Amount]),DATESINPERIOD('Date'[Date],LASTDATE('Date'[Date]),-3,MONTH))/3
-

4 REPLIES 4
Super User

## Re: Variance Minus 1 month

See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...

### I have book! Learn Power BI from Packt

Proud to be a Datanaut!

Community Support Team

## Re: Variance Minus 1 month

Hi @THanley

```Variance = CALCULATE(SUM('ARTransactiontbl'[Positive Amount]),DATESINPERIOD('Date'[Date],LASTDATE('Date'[Date]),-3,MONTH))/3
-

Based on my understanding,

"a dynamic 3 month average" means, eg,

for 2018/10, avg=(2018/8+2018/9+2018/10)/3

for 2018/11, avg=(2018/9+2018/10+2018/11)/3

for 2018/12, avg=(2018/10+2018/11+2018/12)/3

then the percentage of variance should be

for 2018/10, (avg-2018/9)/2018/9

for 2018/11, (avg-2018/10)/2018/10

for 2018/12, (avg-2018/10)/2018/10

Is my understanding right?

Best Regards

Maggie

Regular Visitor

## Re: Variance Minus 1 month

Hi Maggie,

My assupmtion:

<dates>: (CALCULATE(SUM('ARTransactiontbl'[Positive Amount]),DATESINPERIOD('Date'[Date],LASTDATE('Date'[Date]),-3,MONTH))/3

<number_of_intervals>: -1

<interval>: MONTH

Is my assumption incorrect because I have the Calculated Sum as part of the <date>?

Sincerely,

Tom

Regular Visitor

## Re: Variance Minus 1 month

Hi Maggie,

I forgot to respond to your understanding - You are absolutely correct in your math.

Tom

Announcements

#### Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

#### Community News & Announcements

Get your latest community news and announcements.

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 65 members 1,243 guests
Recent signins: