Forum Discussion
Basic CALCULATE question OR a strange phenomenon
- 3 years ago
Have a look at this
https://www.sqlbi.com/articles/side-effects-in-dax-of-the-sort-by-column-setting/
NoIdea . Based on what I got, Try like
Quantity Europe =
CALCULATE (
SUM( Sales[Quantity] ),
Filter(Stores, Store[Continent] = "Europe")
)
Refer: https://youtu.be/cN8AO3_vmlY?t=9300
http://dataap.org/blog/2019/04/22/difference-between-calculate-with-and-without-filter-expression/
- NoIdea3 years agoRegular Visitor
thanx for the reply.
However, I should have explained my original intention a bit more.
My intention was that the mentioned Measure diplays the same value for all fields in the Matrix-Visual. The problem was, that it did not do it, as I was expecting.
I think I understand the difference to your measure (i.e. using FILTER, because CALCULATE evaluates its filter arguments in the original evaluation context).
However, when I understand correctly my measure could be written with FILTER as well:
Quantity Europe = CALCULATE ( SUM( Sales[Quantity] ), Store[Continent] = "Europe" ) Is the same as Quantity Europe FILTER = CALCULATE ( SUM( Sales[Quantity] ), FILTER( ALL( Store[Continent] ), Store[Continent] = "Europe" ) )But in my data model (not the contose sample file) it looks like as if the measure
Quantity Europe = CALCULATE ( SUM( Sales[Quantity] ), Store[Continent] = "Europe" )behaves like this measure
Quantity Europe FILTER woALL = CALCULATE ( SUM( Sales[Quantity] ), FILTER( Store, Store[Continent] = "Europe" ) )which produces this result, that I do not want: