Forum Discussion
DAX functions in CALCULATE
- 8 years ago
Hi,
In your visual drag the Year from the Calendar Table. Write this measure
=CALCULATE(SUM(sheet1[NUmber of sales]),PREVIOUSYEAR(Calendar[Date]))
It was a proposition.
But if you want to see the result on a yearly basis then you need to show the date hierarchy or take it from the calendar table ( and it is an easy one) to get this presentation.
Let us know if you have observations.
Ninter
This issue, especially as you were able to use the sample data and get it to work is very strange to me (and I find the inability to look for errors in power bi pretty frustrating in general). One thing to note is that when I do connect the calendar table and the fact table, power bi actually breaks up the summarizing by date and department:
I don't think this should be impacting the measure and to deal with this I just create a year column and use that instead. Suggestions on other DAX functions to test? Again, I've encountered this issue with both PREVIOUSYEAR and GROUPBY, but since I can't get anything to display in my New column I haven't been able to figure out what's going wrong other than what seems to be an interaction between CALCULATE and the DAX function.