Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi guys,
Looking for suggestions on how to approach this, I created a stacked chart which contains similar legends but different values, i needed them to be stacked in a cronological order, for this i created an index for each for the values, so far looks like this:
as you can see under State column the string values repeat several times, but the chart is stacking them by index, is there a way i can keep the current alignment in the chart but apply specific colors to each of the unique State values? as you can see the word "Static" repeats like 7 times, however the chart provides 7 different colors to that value and i am aiming to get one color only.
thanks for any suggestions.
Solved! Go to Solution.
Hi @Anonymous ,
Try this:
Steps:
1. Add a calculated column.
Legend = [Category] & [Index]
2. Create a table to sort Category in reverse order. Or just use "enter data" to set custom order.
Category =
VAR t =
DISTINCT ( 'Table'[Category] )
RETURN
ADDCOLUMNS ( t, "Order", RANKX ( t, [Category],, DESC, DENSE ) )
3. Create a measure.
1 = 1
4. Create visuals.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Try to use Ribbon Chart inteading of Stacked Column Chart.
Reference: Ribbon Chart is the Next Generation of Stacked Column Chart
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Icey , thanks for your answer,
would be a way to order this by index but only showing unique legend? my problem right now is when aggregating values as i do not need to aggregate nothing but showing the results in cronological order.
Thanks for any guide.
Hi @Anonymous ,
Try this:
Steps:
1. Add a calculated column.
Legend = [Category] & [Index]
2. Create a table to sort Category in reverse order. Or just use "enter data" to set custom order.
Category =
VAR t =
DISTINCT ( 'Table'[Category] )
RETURN
ADDCOLUMNS ( t, "Order", RANKX ( t, [Category],, DESC, DENSE ) )
3. Create a measure.
1 = 1
4. Create visuals.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous, try this:
1. Create a States table.
2. Join States table to Fact table.
3. In Data view, click on States[State] column and sort by Index.
4. In chart, Legend should be States[State].
Proud to be a Super User!
Thanks @DataInsights thats a huge lead,
I will start applying it now, just one more question, so because the state will be changing, for example not alwasy ream up will be the first in the secuence, for example now i have another set of data with HR 20, with different secuence than 19, would this logic would work? the most important part here is to follow the secuence in the secuence for each HR value but providing a specific color for each of the unoique values in states:
@Anonymous,
Would you be able to provide a mock-up of how you want each HR (19 and 20) to look in the chart?
Proud to be a Super User!
@DataInsights , i created this using python,
however this is not guided by index, here is a bit easier but the script takes wayy too long, so for example in HR 19, the secuence is the following:
where ream up is 1, Wash out 2 and on, on HR 20 the secuence is:
where now 1 is rotate drill and 2 ream up, the problem i am facing is that the secuence only works when i out index as legend but each value has a color whereas i need a color for only the uniques. : (
@Anonymous,
I'm not sure how to dynamically change the stack order of each column (may not be possible without a workaround). From what I can see, the first portion of the left column (HR 19) is the largest value (In Slips), and therefore subsequent columns (HR 20) put In Slips as the first portion of the column. This appears to be standard behavior, and I don't see any option to override it.
One last thought--you could browse the custom visuals to see if there's a chart that offers this functionality.
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |