Forum Discussion
Previous year value based on year integer slicer
- 2 years ago
Hi SGBaringa - you are getting that issue because of the filter context applied on slicer calender entity.
can you check the below formaule:
PreviousYearRevenue =
VAR SelectedYear = SELECTEDVALUE('Calendar'[Year])
VAR PreviousYear = SelectedYear - 1
RETURN
CALCULATE(
SUM('Sales'[Revenue]),
'Sales'[Period] = PreviousYear,
ALL('Calendar')
)It works.
Hi, SGBaringa
Based on your information, I I reproduce your situation.
I found no problem with your DAX. When I create a one-to-many relationship, when I use your DAX expression, there are no values in the table view.
You need to untie the two so that the table view shows the values of the previous year, and when there is no previous year, the table view will still appear empty.
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.