cancel
Showing results for
Did you mean:
Highlighted
Frequent Visitor

## Current month vs last year's current month

Hello, im trying to do some calculations with value from current month  and compare it with las years same month as i refresh my data.

I tried the following measure to get Sales from last year's march but, it only showed  total sales of 2018:

CALCULATE(sum(TableX[Sales]);YEAR(TableX[WorkDate]=2018);month(today())=MONTH(TableX[WorkDate))
Example Table:

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: Current month vs last year's current month

Hi @hgzelaya ,

Based on my test, you could refer to below measures:

```Previous = var a=YEAR(MAX('Table1'[WorkDate]))-1
return CALCULATE(SUM(Table1[Sales]),FILTER(ALL('Table1'),'Table1'[Year]=a))```
`Difference = CALCULATE(SUM(Table1[Sales]))-[Previous]`

Result:

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Established Member

## Re: Current month vs last year's current month

The measure looks ok.

Here's my test

Quick tip : to get your questions answered , paste real data not a photo of the data

Community Support Team

## Re: Current month vs last year's current month

Hi @hgzelaya ,

Based on my test, you could refer to below measures:

```Previous = var a=YEAR(MAX('Table1'[WorkDate]))-1
return CALCULATE(SUM(Table1[Sales]),FILTER(ALL('Table1'),'Table1'[Year]=a))```
`Difference = CALCULATE(SUM(Table1[Sales]))-[Previous]`

Result: