Forum Discussion
Dynamic banding in Stacked Column Chart via user input threshold values as comma-separated list
- 1 month ago
Hi SanketMendhe
Unless you can write back to the sourc (using Translytical Taskflows with a Fabric capacity or a third-party service) users can't simply enter an arbitrary value and expect that value to be used directly in visuals.
Also, measures don't have row context, so they can't be used as a legend. A common workaround is to use a disconnected table that the measures can reference. It is possible, but the logic can get pretty complex.
x
The example below demonstrates one way to achieve this.
Please see the attached sample pbix.
Sure, here is the sample data.
Base Table: OrdersFact
| OrderID | OrderDate | Price |
| 1001 | Jan 2026 | 45.00 |
| 1002 | Jan 2026 | 95.00 |
| 1003 | Jan 2026 | 120.00 |
| 1004 | Feb 2026 | 60.00 |
| 1005 | Feb 2026 | 100.00 |
| 1006 | Feb 2026 | 150.00 |
Following is the description for columns in above table:
| Field Name | Data Type | Description |
| OrderId | Integer | Unique identifier for each order |
| OrderDate | Date | Date of the transaction (X-Axis) |
| Price | Decimal | Totoal price of all products in that order. This is to be used for dynamic banding |
Visual Mapping:
We are looking to implement a 100% Stacked Column Chart where:
X-Axis: OrdersFact[OrderDate] (grouped by Year or Month)
Y-Axis: COUNT(OrdersFact[OrderId]) (expressed as 100% relative percentage stacked composition)
Legend (Bands): Segmented by OrdersFact[Price] into dynamic bands.
Expected Dynamic Behavior:
Users specify price thresholds in a comma-separated list form: `86, 111`
The visual segments the total order count into N+1 dynamic price ranges (Here, N = 2):
Band 1: min < 86
Band 2: 87 - 110
Band 3: 111 - max
Bars dynamically recalculate and re-stack whenever threshold parameters change.
The objective is to allow end-users to provide runtime threshold inputs without hardcoding or capping the number of available dynamic thresholds. Entering N comma-separated dynamic values (e.g., 86, 111) should dynamically generate N+1 stacked bands on the chart (e.g., Band 1: < 86, Band 2: 86 - 111, Band 3: > 111).
Expected Visual:
Approaches Explored:
We have evaluated standard Power BI methods, but each carries significant architectural limitations for this specific setup:
1. Numeric Range (What-If) Parameters:
Limitation: Requires creating a fixed, finite number of dynamic parameter slicers in advance (e.g., T1, T2, T3). This caps the dynamic capabilities and does not scale if a user needs to input 5 or 10 dynamic boundaries at runtime.
2. Predefined Threshold Combinations:
Limitation: Requires hardcoding combination mapping tables into the data model. It removes true ad-hoc runtime flexibility for the user.
Since these standard approaches have trade-offs, I am looking for alternative architectural patterns or workarounds that can achieve this functionality.