cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CheenuSing Super Contributor
Super Contributor

Re: Time Intelligence - WTD and MTD Previous Period

@svalen

 

Please do the following

1. Create a column in the Calendar /Date table as

            PYDate = CALCULATE (  DAteadd('Calendar'[Date],-1,Year)  )

 

2. Create a measure called  SalesThisYear

    SalesThisYear = CALCULATE (
                                                  [SalesAmount] ,
                                                                         FILTER (
                                                                                   ALL ( 'Calendar' ),
                                                                          'Calendar'[Year] = MAX ( 'Calendar'[Year] )
                                                                          && 'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
                                                      )
                                                )

  This will give the Sales cumulated uptodate for the current period.

 

3. Create a measure called SalesLatYear

                                                     SalesLastYear = CALCULATE (
                                                                                          [SalesAmount] ,
                                                                                                              FILTER (
                                                                                                                ALL ( 'Calendar' ),
                                                                                                  'Calendar'[Year] = MAX ( 'Calendar'[Year]) - 1
                                                                                                   && 'Calendar'[Date] <= MAX( 'Calendar'[PYDate] )
                                                                                                      )
                                                                                                  )

 

If it works please give Kudos.

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!
svalen Member
Member

Re: Time Intelligence - WTD and MTD Previous Period

@CheenuSing

 

Perfect. Thanks. I should have adapted the logic from the previous measure, now I realise it is simple.

 

Thanks for your support.

GerardoArevalo Regular Visitor
Regular Visitor

Re: Time Intelligence - WTD and MTD Previous Period

@CheenuSing, hi i have a similar problem. I use your formula but when i select for example february I have accumulated what I have in January and February sales, could you please help me in doing something so I do not accumulate sales if I have only one month selected in my filter, if I have several months filtered then if I accumulate these sales.

steph_io Regular Visitor
Regular Visitor

Re: Time Intelligence - WTD and MTD Previous Period

This is formula is key to resolving date calculations.  It absolves the 12 month timeframe and allows to do simple calculations to add or remove months. 

 

YearMonthNumber = ('Calendar'[Year] - MIN( 'Calendar'[Year] )) * 12 + 'Calendar'[MonthNumber]

 

YearMontNumber should not be just YYYY-MM.

 

Thank you!

 

 

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)