Forum Discussion
prabhuk
Helper I
5 years agoError in matrix table
Hello, can you help in identifing the error in the attached file. when i add reagion along with sales and commit table i am getting error. https://www.dropbox.com/s/yly9bouar7rjfz5/BI%20File.pbix?d...
- 5 years ago
mahoneypat
Microsoft Employee
5 years agoI agree you should add a Date table to your model. FYI that you can do your calculation without one (but you really should add one). Here is an example. Also, FYI that you don't need to wrap all your measures in CALCULATE, only when you need to change the evaluation context (like your previous year calculations).
FY20 2 =
VAR vThisYear =
YEAR (
TODAY ()
)
RETURN
CALCULATE (
SUM ( Sales[Sales] ),
FILTER (
ALL ( Sales[DATE] ),
YEAR ( Sales[DATE] ) = vThisYear - 1
)
)
Pat