Forum Discussion
Dynamic segmentation based on the growth
Hi all,
I checked a lot of topics similars than the problem I have but I couldn't find any solution.
I am creating a page to analyse the product performance by territory for a selected cycle.
So, I want to use a scatter chart where I want to display the Market Share growth and the sales. I don't have problems in create the measures.
The problem is that I have a large list of territories and I would like to create a dynamic segmentation with growths ranges.
The idea is use a slicer with ranges and if I don't have any range selected show all the territories but if I select the range 0-10%, show only the territories with growth between these two values.
The range table should be like the following.
RangeLower LimitUpper LimitOrder
| < 0% | 0 | 1 | |
| 0-5 % | 0 | 0,05 | 2 |
| 5-20 % | 0,05 | 0,2 | 3 |
| 20-50% | 0,2 | 0,5 | 4 |
| 50-70% | 0,5 | 0,7 | 5 |
| 70-100% | 0,7 | 1 | 6 |
| > 100% | 1 | 7 |
Thank you very much
Regards
Hi Konrad_Schargel ,
For this you need to add a measure to filter out the data based on the growth.
Create the following measure:
Filter Ranges = var temptable = FILTER('Table (2)', 'Table (2)'[Lower] <= [Growth % Total] && 'Table (2)'[Upper] >= [Growth % Total]) return COUNTROWS(temptable)Now add this measure into the filter of the visual, and select he is not blank option:
4 Replies
- johnt75Super User
I think you need the dynamic segmentation pattern - https://www.daxpatterns.com/dynamic-segmentation/
- MFelixSuper User
Hi Konrad_Schargel ,
For this you need to add a measure to filter out the data based on the growth.
Create the following measure:
Filter Ranges = var temptable = FILTER('Table (2)', 'Table (2)'[Lower] <= [Growth % Total] && 'Table (2)'[Upper] >= [Growth % Total]) return COUNTROWS(temptable)Now add this measure into the filter of the visual, and select he is not blank option:
- Konrad_SchargelFrequent Visitor
- Kedar_PandeSuper User
Create a measure:
IsInSelectedRange =
VAR SelectedLowerLimit = SELECTEDVALUE(RangeTable[Lower Limit])
VAR SelectedUpperLimit = SELECTEDVALUE(RangeTable[Upper Limit])
VAR CurrentGrowth = [MarketShareGrowth]
RETURN
IF (
ISBLANK(SelectedLowerLimit) && ISBLANK(SelectedUpperLimit),
TRUE, // Show all if no range is selected
CurrentGrowth >= SelectedLowerLimit && (ISBLANK(SelectedUpperLimit) || CurrentGrowth < SelectedUpperLimit)
)Apply the Measure as a Visual Level Filter to show items when the measure is TRUE.
💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn