Forum Discussion
Calculated column on calculation group table
Hi 2366
With Calculation Groups, a Calculation Item will only be applied if a single value is filtered in the original Calculation Item column, "Name" in your case.
Unfortunatley, it is not sufficient to crossfilter this column by filtering another columnin the same Calculation Group table.
One way around this that I have used in the past is to create an additional Calculation Group which applies a filter on the "Name" column of the original Calculation Group.
You would then apply a filter on the 2nd Calculation Group's single Calculation Item, which would have the effect of applying the original Calculation Group filter but allowing for crossfiltering.
Here is a Tabular Editor DAX script for an example I have for a Time Intelligence Calculation Group:
-----------------------------------------------
-- Calculation Group: 'Apply Time Intelligence'
-----------------------------------------------
-- This Calculation Group has a single Calculation Item
-- that applies a filter corresponding to the visible value(s)
-- of the original 'Time Intelligence' Calcuation Group.
-- In effect, this allows filtering of the original Calculation Group
-- using columns other than the original Calculation Item column.
CALCULATIONGROUP 'Apply Time Intelligence'[Name] Precedence = 1
CALCULATIONITEM "Apply Time Intelligence" =
CALCULATE (
SELECTEDMEASURE (),
VALUES ( 'Time Intelligence'[Time Calc] )
)
FormatString =
CALCULATE (
SELECTEDMEASUREFORMATSTRING (),
VALUES ( 'Time Intelligence'[Time Calc] )
)
Regards