cancel
Showing results for
Did you mean:
Highlighted
Member

## leap year correction

Hi,

I have made measures that show last 12 and 24 months (rolling 12 month/24 months),
When I select year 2020 I get a wrong value for February.

case sales:

2019 value 28th feb = 20

year           last 12 month   last 24 month
2020                                   (2019)
feb            10                       40
28th          10                       20
29th           -                         20

There is an extra line for the 29th day in feb-2020 and this get the same value as 28th feb 2019. How can I correct for the leap year error?

N is number of months

Salgsinntekt forrige N mnd =
var Ldato = DATE(MAX('Year'[year]);MAX(Mnd[order])+1;1)
var Fdato = EDATE(Ldato;-(MAX(N[N])))
var Sales = CALCULATE([Sales];SAMEPERIODLASTYEAR(Calendar[date]))

return
if(min(Calender[date])<Fdato;
blank();
if(min(Calender[date])>=Ldato;
blank();
Sales)

Community Support

## Re: leap year correction

Hi @Coan7 ,

Best Regards,

Icey

Announcements

#### Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

#### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

#### Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.