Forum Discussion
Is this a bug?
So i attempted to recreate previous year. By this I used year (date) -1, but then it went very bad. Even date(year(date)-1 , month , day) went completely bad. Entering just but year (date) does work though.
I don't have pro yet, so I can't log it at the support page. I will be given it in time, but that will take a while. You know... companies...
Is this year(date)-1 a bug?
Before there are issues
9 Replies
- v-danhe-msftMicrosoft Employee
Hi DouweMeer ,
Based on my test, it could work on my side:
Could you please post your data to have a test if possible?
Regards,
Daniel He
- DouweMeerImpactful Individual
v-danhe-msft , no, can do :).
Besides... I've been several times with the following:
A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.
I'll consider it to be an error on my machine and wait for the new laptop I've been promised. In the mean time I'll put my hopes on the Microsoft contact we have with our company, perhaps he knows something. Haven't heard anything yet throught that channel sadly enough. Still... hopes keep you alive :).
- v-danhe-msftMicrosoft Employee
Hi DouweMeer ,
Ok, if you have gotten any useful solution to solve your problem, don't forget to close this topic.
Regards,
Daniel He
- NishantjainContinued Contributor
I can see 2 reasons:
1. your date column is not in the date format, possibly is in text format.
2. You are using max function and it is not returning a date. Possibly, there are "blank" in your date field.
Looking at your issues, the year(date)-1 is returning 0, and when using in a date function date(0,12,31) gives 31/12/1899 as the output.
Replace the max function as below and see if it works
test measure = date(year(date(2019,01,15)-1, 12,31)
This will atleast proof whether there is a bug or not.
- DouweMeerImpactful Individual
Nishantjain , first of all, the data type is indeed in date/time.
Second, see below printscreens of an example why, to my opinion, it should show the correct data.
If you know of a test I could do, or you v-danhe-msft , I can give it a try to see if something else is wrong.
- NishantjainContinued Contributor
I can see that there is something wrong with your data.
- In the first screenshot, you can see the correct year in "Measure 4" against group 11666 i.e 2017
- However, in you second screenshot, "Measure 4" is blank. Assuming that "Measure 4" is the same in both the screenshot, I expect to see a year again business group 10-010-CMR but it is blank. So, if the year is blank, then your "Measure 3" will given -1.
Assuming I have understood your screenshots correctly, the dax function is doing what it is expected to do.
Also, the 2 screenshots are showing different business groups. Can you try to create a screenshot where "Measure 4" has 2017 ( or anothe year) and "Measure 3" is showing -1 against the same business group
Thanks