Error in "PowerPivot for the Data Analyst" book, page 247.

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>
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,223,603
Messages
6,173,308
Members
452,510
Latest member
RCan29

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top