• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Filtering Dates

Shay A

Member
Hi,
If I want to create a measure to show only sales of the latest day available in my data set. Can I use something like this, CALCULATE([TOTAL SALES], MAX(DATES(DATE)])?

TY,
Shay
 
Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

Remember to desensitize the data.
 
Typically speaking, no. You'd need to use Max of Date column in the fact table and not in date dimension table.

Typical Construct...
Code:
=CALCULATE(SUM(Sales[Amount]),FILTER(Sales,Sales[Date]=MAX(Sales[Date])))

Since, Date dimension table should hold all dates in given year (ex: 1/1/2018 to 12/31/2018). MAX will always return last day of year (period) in dimension table.
 
Back
Top