Forum Discussion
Dynamic last December previous year with DAX
Anonymous - The error you are getting seems to indicate that you need to wrap any column references you have in the formula with an aggregation like MAX, MIN, etc.
Greg_Deckler Thanks for your reply.
I've been looking in to that, and I don't think that it's about MIN, MAX stuff, but rather that my time-dimension is a bit wrong. We don't have any real dates, just a month-date like 2020-09-01 and that's september. And the next month-date is 2020-10-01, so there is no real regularity to our dates.
Or mayby that the formula needs a more specific date or something? Do you have any thoughts about that?
I'm sorry for the lack of information, but as I said from the beginning, I'm a newbie at DAX (don't really get it, it's a **bleep**ty kind of language....) and I'm not great at Excel for that matter so I have a bit of trouble understanding how it works.
But thank you for taking the time mate!
- Greg_Deckler6 years ago
Community Champion
Anonymous The error you are getting indicates that a table of values is being returned when it expects a scalar. This means you are missing an aggregation somewhere. Easiest way to get around that many times is just wrap you column reference in an aggregation like MAX.
- Anonymous6 years agoNot applicable
Have been trying some options, and I thank you for you input. amitchandak I gave it shot, but it didn't really work. How ever, this seemed to work:
LastPeriodPreviousYear:= Date(year(MAX(Period[Month_Date]),0)-1,12,31)Thank you so much for your input Greg_Deckler and amitchandak