You can use KEEPFILTERS like this -
CALCULATE ( [Measure], KEEPFILTERS ( Table[Column] = “Something” ) )
It depends 11 Separate measures could be more efficient if written in the right way, Calculation Groups are not higly optimized at the moment. But there is a caveat, IF and SWITCH can use either Strict or Eager evaluation method to evaluate the measures so without looking at the setup I can’t confirm.
DAX Studio is the best tool for identifying the bottleneck and I created 2 courses for EDNA in January that help newbies in getting started with DAX Studio and DAX optimizations.
Some other resources (not all are for optimization):
Plenty of useful reading there. Might do some of that on hols.
I seem to have fixed a good lump of my speed problem with a hard look at the ROLLUPADISSUBTOTAL piece of my code and reducing 4 Rollups into 2. So now code is running in 40s rather than 80s which is cool.
I’ll take at look at some of your stuff in a couple of weeks when back from hols because I think there is more I can do here.
Going back to KEEPFILTERS it is the blank bit that is tricky. So this works
but this KEEPFILTERS(Reports[PagRepGroup002]<>Blank()) gives aggregation error and this KEEPFILTERS(max(Reports[PagRepGroup002])<>Blank()).
This is all happening within a SUMMARIZECOLUMNS pattern.
Hi @petesmith673, due to inactivity, a response on this post has been tagged as “Solution”. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box.