RonBarrett
New Member
- Joined
- Jul 10, 2013
- Messages
- 4
Error in "PowerPivot for the Data Analyst" book, page 247
After purchasing the book and eagerly reading through it (great book), I noticed an error on page 247 regarding "Sales for the last 30 days". (I'm particularly interested in this calculation because I want to create a rolling 6-month total.) The DatesInPeriod function takes a <start_date> parameter, which is a date expression. However, the book's example says to set <start_date> to equal FirstDate(Sls[Date]), [Date] being a column in the Sls table. (BTW, the <start_date> parameter is missing from the full formula example found at the bottom of page 247.)
When creating the new measure in Excel I clicked the "Check formula" button and an error message indicated the DatesInPeriod function only accepts a date column as the first parameter. In other words the FirstDate function isn't allowed. (This is true for the DATESBETWEEN function also.)
What is the correct Dax formula to create a total that rolls over a given period whether it's 30 days, 6 months, etc.?</start_date></start_date></start_date>
After purchasing the book and eagerly reading through it (great book), I noticed an error on page 247 regarding "Sales for the last 30 days". (I'm particularly interested in this calculation because I want to create a rolling 6-month total.) The DatesInPeriod function takes a <start_date> parameter, which is a date expression. However, the book's example says to set <start_date> to equal FirstDate(Sls[Date]), [Date] being a column in the Sls table. (BTW, the <start_date> parameter is missing from the full formula example found at the bottom of page 247.)
When creating the new measure in Excel I clicked the "Check formula" button and an error message indicated the DatesInPeriod function only accepts a date column as the first parameter. In other words the FirstDate function isn't allowed. (This is true for the DATESBETWEEN function also.)
What is the correct Dax formula to create a total that rolls over a given period whether it's 30 days, 6 months, etc.?</start_date></start_date></start_date>