+ Reply to Thread
Results 1 to 2 of 2

MAT Measure, LASTDATE not Correct expression to use?

  1. #1
    Registered User
    Join Date
    11-29-2013
    Location
    Peterborough, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    MAT Measure, LASTDATE not Correct expression to use?

    Hi - I'm trying to build an MAT measure as a calculated field in a pivot table. (DAX).

    I have weekly data.

    I used the LAST Date to get the most recent date of sales but when I go to the date 1 year back, I think it fetches the last date of that month.

    I've worked out that my MAT measure runs from 01/04/2019 - 09/03/2020 (missing out 18/03/19 and 25/03/19).

    The expression I used was:

    =CALCULATE (
    SUM (Weekly_Flat_File[VALUES STG] ),
    DATESINPERIOD ( Weekly_Flat_File[Week Commencing], LASTDATE (Weekly_Flat_File[Week Commencing] ), -1, YEAR ))

    (week commencing = date)
    (VALUES STG = Sales)

    So I need to find the most recent date every time the flat file is refreshed and then the corresponding date 1 year back.

    09/03/20 52 weeks back = week 12 2019 - 18/03/2019 - week 11 2020 - 09/03/2020

    There are columns in the data for Week, Week Number and Year formatted like WK1120, 11, 2020 if it would be easier to somehow use those?

    Thanks for any advice

    Mark

  2. #2
    Registered User
    Join Date
    11-29-2013
    Location
    Peterborough, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: MAT Measure, LASTDATE not Correct expression to use?

    Marked as solved because I don't think it is possible to solve. The expression above works fine with monthly data.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pivot Table: Grand Total different measure from Column measure
    By chinneywow in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-07-2019, 06:22 AM
  2. Replies: 3
    Last Post: 05-25-2017, 06:27 AM
  3. [SOLVED] Formula for Predictions League - 3 points correct score or 1 point correct result
    By daveyboy1681 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-17-2016, 04:09 PM
  4. Replies: 15
    Last Post: 11-25-2014, 08:14 AM
  5. [SOLVED] Range Address Is Correct Columns Count Is Not Correct
    By goss in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-09-2013, 12:47 PM
  6. Replies: 1
    Last Post: 09-17-2012, 09:35 AM
  7. Fix Needed for Code to Send Correct Data to Correct Sheets
    By swordswinger710 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-04-2012, 03:53 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1