Forum Discussion
xariet
Helper I
3 years agoDynamic Segmentation
Hi All I am struggling to correctly calculate bins_Segments. I have an Annual Income table : Annual Income = GENERATESERIES(18000, 1560000,1000) and [Value1] is the column in this table with gen...
- 3 years ago
Hi xariet ,
According to your description, I create a same sample and here's my solution, create a measure.
Bins_segments = CALCULATE ( COUNTROWS ( SUMMARIZE ( 'Annual Income', 'Annual Income'[Value1] ) ), FILTER ( 'Annual Income', MOD ( 'Annual Income'[Value1] - MINX ( ALL ( 'Annual Income' ), 'Annual Income'[Value1] ), SELECTEDVALUE ( 'Parameter'[What is bin size] ) ) = 0 && NOT ( ISEMPTY ( FILTER ( param_Segment, NOT ( ISBLANK ( 'Annual Income'[Value1] ) ) && param_Segment[Min] < 'Annual Income'[Value1] && param_Segment[Max] >= 'Annual Income'[Value1] ) ) ) ) )Get the correct result.
I attach my sample below for your reference.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best regards,
Community Support Team_yanjiang
v-yanjiang-msft
Community Support
3 years agoHi xariet ,
According to your description, I create a same sample and here's my solution, create a measure.
Bins_segments =
CALCULATE (
COUNTROWS ( SUMMARIZE ( 'Annual Income', 'Annual Income'[Value1] ) ),
FILTER (
'Annual Income',
MOD (
'Annual Income'[Value1]
- MINX ( ALL ( 'Annual Income' ), 'Annual Income'[Value1] ),
SELECTEDVALUE ( 'Parameter'[What is bin size] )
) = 0
&& NOT (
ISEMPTY (
FILTER (
param_Segment,
NOT ( ISBLANK ( 'Annual Income'[Value1] ) )
&& param_Segment[Min] < 'Annual Income'[Value1]
&& param_Segment[Max] >= 'Annual Income'[Value1]
)
)
)
)
)
Get the correct result.
I attach my sample below for your reference.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best regards,
Community Support Team_yanjiang