Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: SAMEPERIODLASTYEAR not working

  1. #1
    Board Regular
    Join Date
    Nov 2005
    Posts
    319
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default SAMEPERIODLASTYEAR not working


    SAMEPERIODLASTYEAR not working
    I keep getting the same results for the current period and the prior period.

    My formulas are:

    Total Cost = sum(Data[Claim_Cost])

    Total Cost LY = Calculate([Total Cost],SAMEPERIODLASTYEAR('Date'[Date].[Date]))

    When I drop these two measures into a table visual, I get the same value for each month/year.

    e.g.

    Jan 2015 - Shows 39M for both Total Cost and Total Cost LY.

    Whereas Jan 2015 was 39M and Jan 2014 was 34M

    Thank you.

  2. #2
    MrExcel MVP
    Join Date
    Dec 2014
    Location
    Sydney, Australia
    Posts
    976
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: SAMEPERIODLASTYEAR not working

    Quote Originally Posted by Sharkie21 View Post
    I keep getting the same results for the current period and the prior period.

    My formulas are:

    Total Cost = sum(Data[Claim_Cost])

    Total Cost LY = Calculate([Total Cost],SAMEPERIODLASTYEAR('Date'[Date].[Date]))

    When I drop these two measures into a table visual, I get the same value for each month/year.

    e.g.

    Jan 2015 - Shows 39M for both Total Cost and Total Cost LY.

    Whereas Jan 2015 was 39M and Jan 2014 was 34M

    Thank you.
    try deleting the last.[date] so just use Date[Date]
    Matt Allington is a Professional Power BI consultant, trainer and Microsoft MVP based in Sydney Australia at http://Exceleratorbi.com.au.
    Author of the book Learn to Write DAX
    What is Power Pivot?

  3. #3
    New Member
    Join Date
    Sep 2014
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: SAMEPERIODLASTYEAR not working

    Quote Originally Posted by Matt Allington View Post
    try deleting the last.[date] so just use Date[Date]
    Hi Matt,

    Could you please explain what the difference is?

    Thanks

  4. #4
    MrExcel MVP
    Join Date
    Dec 2014
    Location
    Sydney, Australia
    Posts
    976
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: SAMEPERIODLASTYEAR not working

    Microsoft has built capabilities for Power Pivot to do time intelligence calculations without the need for a calendar table. This is called auto time telligence. It can be turned off in the settings. The date.date syntax is part of that auto time intelligence. It is designed (in my view) for "casual" use of Power Pivot without the need to know DAX. I personally never use it and prefer to have control with a calendar table.
    Matt Allington is a Professional Power BI consultant, trainer and Microsoft MVP based in Sydney Australia at http://Exceleratorbi.com.au.
    Author of the book Learn to Write DAX
    What is Power Pivot?

  5. #5
    New Member
    Join Date
    Sep 2014
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: SAMEPERIODLASTYEAR not working

    Quote Originally Posted by Matt Allington View Post
    Microsoft has built capabilities for Power Pivot to do time intelligence calculations without the need for a calendar table. This is called auto time telligence. It can be turned off in the settings. The date.date syntax is part of that auto time intelligence. It is designed (in my view) for "casual" use of Power Pivot without the need to know DAX. I personally never use it and prefer to have control with a calendar table.

    Thanks Matt

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com