Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AndrejZitnay
Post Patron
Post Patron

Problem with 12month cumulative

Hello all,

 

I have bit of problem with 12 month cumulative.

If I use monthly breakdown than figures are right. Problem is with 12 month cumulative.

For some reason only two months doesn't match and it doesn't make sense to me.

Out of 12 months cumulative form Jan-16 to Sep-17 only Feb-17 & Sep-17 are out of sync.

 

Can you redirect me to some solution?

 

Date:

MonthYear = FORMAT([Date],"mmm")&"-"&FORMAT([Date],"yy")

MasterCalendar = CALENDAR(MIN('Date Table'[COMPLETIONDATE]),MAX('Date Table'[COMPLETIONDATE]))

 

Values :

 

12 Month Settlements = CALCULATE([Settlements],DATESBETWEEN(MasterCalendar[Date],NEXTDAY(SAMEPERIODLASTYEAR(LASTDATE(MasterCalendar[Date]))),LASTDATE(MasterCalendar[Date])))

 

Settlements = CALCULATE(COUNTROWS(Terminations),FILTER(Terminations,Terminations[Type_1]="Settlements"))

 

Many thanks.

 

Kind reards.

 

Andrej

1 ACCEPTED SOLUTION

@AndrejZitnay

 

Hi, try adding EndofMonth in your measure:

 

12 Month Settlements V2 =
CALCULATE (
    SUM ( Hoja1[Settlements] ),
    DATESBETWEEN (
        MasterCalendar[Date],
        NEXTDAY (
            ENDOFMONTH ( SAMEPERIODLASTYEAR ( LASTDATE ( MasterCalendar[Date] ) ) )
        ),
        LASTDATE ( MasterCalendar[Date] )
    )
)

Regards

 

Victor

Lima - Peru




Lima - Peru

View solution in original post

4 REPLIES 4
v-sihou-msft
Employee
Employee

@AndrejZitnay

 

I can't reproduced your issue. And your formula looks good to me. What are the results on  Feb-17 and Sep-17? 

 

Can you share your .pbix for test?

 

Regards,

Hello @v-sihou-msft

 

Unfortunately I can't share much however I have found something about why this two months are out of sync.

 

Difference in my 12 months total for September is 236

I find out that for some reason my formula picked up data for 09/30/16 where it shoudn't

In Sep-17 12 months total should have data from Oct-16 to Sep-17

 

In Feb-17 12 month total should have data from March-16 to Feb-17 

I can see that my formula picked up here as well data from 29/02/2016.

It could be case that we have 29 days in February only once every 4 years?

 

12 Month Settlements = CALCULATE([Settlements],DATESBETWEEN(MasterCalendar[Date],NEXTDAY(SAMEPERIODLASTYEAR(LASTDATE(MasterCalendar[Date]))),LASTDATE(MasterCalendar[Date]))) 

 

I am not sure if my formula look for exact day or day within month and than calculate 12 month total.

 

Last day.JPGfirst day.JPG

 

Can you help?

 

thx

 

Andrej

@AndrejZitnay

 

Hi, try adding EndofMonth in your measure:

 

12 Month Settlements V2 =
CALCULATE (
    SUM ( Hoja1[Settlements] ),
    DATESBETWEEN (
        MasterCalendar[Date],
        NEXTDAY (
            ENDOFMONTH ( SAMEPERIODLASTYEAR ( LASTDATE ( MasterCalendar[Date] ) ) )
        ),
        LASTDATE ( MasterCalendar[Date] )
    )
)

Regards

 

Victor

Lima - Peru




Lima - Peru

Hello @Vvelarde,

 

That works for me.

Thank you very much for your help.

 

Much appreciated.

 

Kind regards.

 

Andrej

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.