Is there a way to return the filter name(s) of the current filter context in a DAX-measure?
Background: Want to calculate aggregates on time series only if they are complete. I.e. if it is a monthly time series with values from Jan 2014-Aug 2015, then the aggregations for 2014 will all be shown: annual, as well as all 4 quarters. But for 2015 only the first 2 quarters aggregations shall be shown (no unfinished quarters and year).
So I need to check which filter context applies in the current cell (annual or quarter) in order to determine the necessary conditions (for an annual aggregations of monthly time series there must be 12 values reported already, whereas for a quarterly aggregation I need only 3 monthly values (..and for a quarterly time series only 4 reported values are necessary for the annual aggregation).
So the measure needs to detect the current filter context (quarter or year) in order to return the minimum-number of reported periods. This will then be compared against the actual number of reported periods and if they match, the aggregation will be shown.
So my current approach is to count the number of months in the calender and determine the selections based on that (if 12, then year, if 3, then quarter...) but as this is on very large tables, I'm looking for performance improvements.
If there is a better solution than this approach – please tell!
Background: Want to calculate aggregates on time series only if they are complete. I.e. if it is a monthly time series with values from Jan 2014-Aug 2015, then the aggregations for 2014 will all be shown: annual, as well as all 4 quarters. But for 2015 only the first 2 quarters aggregations shall be shown (no unfinished quarters and year).
So I need to check which filter context applies in the current cell (annual or quarter) in order to determine the necessary conditions (for an annual aggregations of monthly time series there must be 12 values reported already, whereas for a quarterly aggregation I need only 3 monthly values (..and for a quarterly time series only 4 reported values are necessary for the annual aggregation).
So the measure needs to detect the current filter context (quarter or year) in order to return the minimum-number of reported periods. This will then be compared against the actual number of reported periods and if they match, the aggregation will be shown.
So my current approach is to count the number of months in the calender and determine the selections based on that (if 12, then year, if 3, then quarter...) but as this is on very large tables, I'm looking for performance improvements.
If there is a better solution than this approach – please tell!
Last edited: