Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
xangetsu21
Frequent Visitor

stacked column chart with higher value as the height and on top and lower value on bottom

I have a stacked column chart in power BI from a table containing daily option trading data. the table has columns : DATE, CONTRACT MONTH, STRIKE, P/C, OI. Here DATE is the trade date, CONTRACT MONTH is the contract month, STRIKE is the strike price, P/C is whether they are puts(P) or calls(C) and OI is the open interest. now the chart has two values on x axis STRIKE and then DATE. and OI is on y axis. so the chart is showing value of OI for each date for each strike. I also added P/C as the column legend so the columns are showing bars stacked with two colors: red for P and green for C. the column height is of the total values of OI and its showing the proportionate colored portion for C and P in each bar. but i want this chart to display the higher of the value of OI in P or C (whichever is higher for that strike and date) as the column height and the lower value of OI ( whether p or c is lower for that strike and date) to be shown in the lower part of the column in the selected color for that. and the rest of the bar would be the opposite color which is of the higher value of OI between P and C. for example lets say for STRIKE: 190, DATE: 9th february, the value of OI for C is 4416 and the value of OI for P is 2040. for this column, the total height will be 4416 with the height of 2040 red (since color for P is red) and the rest of the above portion is green. so it will always show the lower value at the bottom and higher value on top and the height is that of the higher value

Screenshot (90).png

3 REPLIES 3
xangetsu21
Frequent Visitor

its a simple ask. you dont need data to answer to this. i added a legend( a column of the table which has ONLY TWO DISTINCT VALUES) to the stacked bar chart. and the bars or columns(whichever you call it) on the chart are adding the values of each of the legend and has height of the total values. But i want the bars to have height of the higher value among those two and the lower value to be bottom with its value projected on the bar in its selected color. 

v-heq-msft
Community Support
Community Support

Hi @xangetsu21 ,
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Best regards,

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

for example you made a stacked column chart for workouot duration for morning and evening. duration is on y axis and you added the time of the day( which has MORNING and EVENING)  to the legend. suppose for today the morning duration was 60 minute and evening was 40 minute. you selected color of morning as green and evening as blue. for this instance you want the bar to be of height 60 and "0 to 40" of that bar would be blue and the rest of the above would be green. if it was reverse for morning and evening like 40 minutes in morning and 60 minutes in evening, the bar would be of same height of 60 but the lower portion would be green and upper portion would be blue. you get it? i want that chart

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.