Forum Discussion
ktt777
Helper V
5 years agoSORTING, DISPLAY CLUSTERED BAR CHART
Hi, i have below clustered bar chart. I have few questions: 1.How can i sort it based on Total of blue + red value ? Right now i can only sort either blue or red value 2. How can i show percenta...
- 5 years ago
please see the attachment below.
ryan_mayu
Super User
5 years agosince you don't provide the sample data , I created some simple data.
1. did you create a measure to calculate the value? what's your measure? it should sort by total by default
2.you can create a measure
perc = sum('Table (3)'[amount])/CALCULATE(SUM('Table (3)'[amount]),ALLEXCEPT('Table (3)','Table (3)'[product]))
or add that measure to tooltips
3. I think the workaround is to create a new table
new table =
var tbl=ADDCOLUMNS(SUMMARIZE('Table (3)','Table (3)'[product],'Table (3)'[type],"amount",sum('Table (3)'[amount])),"percentage",[amount]/CALCULATE(sum('Table (3)'[amount]),ALLEXCEPT('Table (3)','Table (3)'[product])))
return FILTER(tbl,[percentage]>=0.8&&'Table (3)'[type]="1" || [percentage]<0.2 && 'Table (3)'[type]="2")
- ktt7775 years ago
Helper V
thank you a lot.
Link to example file : https://1drv.ms/x/s!ApIDnMK2eKiFgRkOMv8RFE4QmD25?e=xcTQa9
Page 1: How to sort by total. Example 2019, Apple should be above Orange
How to create tooltip to show : Orange, Asia 40, 62% ( percentage of Asia in Orange type only)
PAge 2: How to create tooltip to show : China, Qty 74, 55.6 % ( percentage of China over 2019 total)
thanks