Forum Discussion
DAX Year() Not Returning the Year
- 10 years ago
Hi @Dave,
When you adding a calculated column using Year() DAX function, it builds an integer a column.
And by default, all integer cols are summarized by using sum, that's why you have the total under your year column.
Open you model, select your table and "year" column, go to "Modeling" menu and change the property "Default Summarization" from "Sum" to "Do not summarize"
Something wonky, not able to recreate. I was using "Enter Data" and just typed in the date time values as shown in your example below. All was good. What is the data source? In your model, if you select your Date column, on the Modeling ribbon, is the Data Type set to "Date/Time" and is the Format "*3/14/2001 1:30:15 PM (G)"?
As for M versus DAX I'd say that's a pretty obvious choice in your case! :)
Seriously though, there are different schools of thought there. One school of thought is to do as much as humanely possible in M to transform the data to how you want it before it gets to your model. However, one should also consider supportability and maintainability as well. For example, if I have to do some of the work in DAX, then I favor doing it all in DAX so that I am not mixing languages. Nobody wants to support a C#, java, perl, ruby mish mash of sadness. And, who will be maintaining it long term matters in terms of their skils in my opinion as well. Can they handle M or is DAX a better fit?