Forum Discussion
Calculate and filter context
- 3 years ago
So I found the solution. The solution is off course crazy becasue there is no clear information about this almost nowhere. Seems that DAX is real hell. So...as far as I understand:
If someone uses calculate with [date] column and:-[date] column is a connector to other tables OR
-if table is "marked as date table" (when a date table is connected with other table but by other column ie. DateKey)
=> the ALL('date table") is added to the formula. This happend in the background (and of course almost no one knows it and you will not see it). Congrats for DAX developers.
Hi,
Your measure returns always the same value (the sales of 27.1.2023). Now what is happening is that you have hard-coded a filter to your measure. So basically your measure = "calculate sales from fact table, but only consider the values on date 27.1.2023. Since your visual uses values from your calendar table an you likely have 1:m relationship between your fact and calendar table, from your visuals perspective every month will get the same value. E.g on February the measure will still get the same value since it considers the 27.1.2023 date. However if you were to use data from your fact table your visual would make sense:
Using column from calendar:
using column from fact:
Only January gets values so only it is displayed.
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
Actually I don't understand it. What means I hard coded it? These rules for CALCULATE works in every other table in a model.