cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## three month leaves - same period last year

Hi

how to write DAX function about , last three month leaves - same period last years ?

Thanks

sreenivasa

1 ACCEPTED SOLUTION

Accepted Solutions
Super Contributor

## Re: three month leaves - same period last year

Hi @Anonymous,

Could you try using the formulas below to see if it works in your scenario?

```three month leaves =
VAR currentDate =
MAX ( Date[Date] )
RETURN
CALCULATE (
SUM ( Table1[Value] ),
DATESINPERIOD ( Date[Date], EDATE ( currentDate, -3 ), 3, MONTH )
)
```
```three month leaves same period last year =
VAR currentDate =
MAX ( Date[Date] )
RETURN
CALCULATE (
SUM ( Table1[Value] ),
DATESINPERIOD ( Date[Date], EDATE ( currentDate, -15 ), 3, MONTH )
)
```

Regards

Super Contributor

## Re: three month leaves - same period last year

Hi @Anonymous,

Could you try using the formulas below to see if it works in your scenario?

```three month leaves =
VAR currentDate =
MAX ( Date[Date] )
RETURN
CALCULATE (
SUM ( Table1[Value] ),
DATESINPERIOD ( Date[Date], EDATE ( currentDate, -3 ), 3, MONTH )
)
```
```three month leaves same period last year =
VAR currentDate =
MAX ( Date[Date] )
RETURN
CALCULATE (
SUM ( Table1[Value] ),
DATESINPERIOD ( Date[Date], EDATE ( currentDate, -15 ), 3, MONTH )
)
```

Regards

Announcements

#### Back to School Contest

Engage and empower students with Power BI!

#### Watch Sessions On Demand!

Continue your learning in our online communities.

#### Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

#### PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Top Kudoed Authors
Users Online
Currently online: 6 members 806 guests
Recent signins: