TOTALYTD optional parameters

A dedicated forum to help people when working through the book "Learn to Write DAX"
pivotuser
Posts: 1
Joined: Sat Dec 01, 2018 7:05 am

TOTALYTD optional parameters

Postby pivotuser » Sat Dec 01, 2018 7:46 am

Hi,
I'm working with Supercharge Excel, exercise 63, Total Sales FYTD 30 June. The book's measure works for me, but I am not sure about how the optional parameters are handled when missing.

When I look at online examples indicate to use a comma when you are not using an optional parameter.

The third parameter on TOTALYTD is filter, which is optional. If I leave it out (and use the 4th parameter for fiscal year) using a comma the formula checker gives me an error --> 'Argument '3' in TOTALYTD function is required. If I leave the 3rd parameter out, use the 4th, and have no comma then it works.

(1) =TOTALYTD([Total Sales],'Calendar'[Date],"6/30") -- from the book, this works, no 3rd parameter, but also no comma.

(2) =TOTALYTD([Total Sales],'Calendar'[Date],,"6/30") -- use a comma for optional 3rd parameter, get error mentioned above.

(3) =TOTALYTD([Total Sales],'Calendar'[Date],ALL('Calendar'),"6/30") -- include 3rd parameter (filter), this works.

Does anyone know why #1 above works, but not #2?

Thanks!

Return to “Help with the Book "Learn to Write DAX"”

Who is online

Users browsing this forum: No registered users and 0 guests

cron