A dedicated forum to help people when working through the book "Learn to Write DAX"
2 posts • Page 1 of 1
Possible error in first paragraph of page 125. Manual YTD formula works for me if I swap out the MAX(...) bit for YEAR and put in MIN(...) or AVERAGE(...). But it does not work if I put in SUM(...). If SUM(...) actually should work then please (pretty please, with sugar on top) explain why. Because I when I read that last sentence in the first paragraph my first reaction was "SUM()?! Really?! Then I really don't know what's going on here!".
Yes it should work with sum. You have to clear your mind of what these functions were designed to be used for as their main purpose and instead break the problem into pieces. When you use a YTD function, you always have an initial filter context on a single year. This means there is only 1 value for year in the current filter context. It therefore follows if you SUM() that single value, you will return that single value. If you take the AVERAGE() of that single value, you will return that single value. Same with min and max.
Who is online
Users browsing this forum: No registered users and 3 guests