I've used the Clustered Sales example from sqlbi (Dynamic Segmentation – DAX Patterns) to good effect. In my case, the properties is effectively the customer and UnitTape contains the sales.
This works perfectly. What I now want to do is take the resulting table and split the sales by type (a column in the UnitTape table). However, if I put a filter on the table then it dynamically recalculates the constituents. I suppose I really want to freeze the results of the second clause which determines which properties are included in which bucket, and then be able to segment.
I tried wrapping the [NumProperties] measure in another CALCULATE to apply a filter, but it didn't work.
Thanks
Code:
OrigNumberOfPropertiesClustered =
CALCULATE (
[NumProperties],
FILTER (
ADDCOLUMNS (
'Properties',
"RankValue", CALCULATE (
SUM ( UnitTape[Last Bank Appraisal Value (€)] ),
CALCULATETABLE ( 'Properties' ),
ALLSELECTED ()
)
),
COUNTROWS (
FILTER (
ValueSegment,
[RankValue] > ValueSegment[Min]
&& [RankValue] <= ValueSegment[Max]
)
)
> 0
)
)
This works perfectly. What I now want to do is take the resulting table and split the sales by type (a column in the UnitTape table). However, if I put a filter on the table then it dynamically recalculates the constituents. I suppose I really want to freeze the results of the second clause which determines which properties are included in which bucket, and then be able to segment.
I tried wrapping the [NumProperties] measure in another CALCULATE to apply a filter, but it didn't work.
Thanks