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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Sorting chart without visualizing data being sorted

Hi all! My data is set up as below. Column 2 is just a placeholder for a bunch of columns that are not currently relevant. Abs Diff (or Absolute Difference) is the combined distance of Max and Min from Mean. So for Row 1, its |7 - 3| + |9 - 7| = 6. The Max and Min % Diff are just the percentage of the difference from the Mean. So for Row 2, Max % Diff is (9 - 2)/7 = 28%.

MonthCategory Column 2NameMinMeanMaxAbs DiffMax % DiffMin % Diff
Jan 2022AadjasdaItem_X55105100%0%
Feb 2022BafnsaofsItem_Y379628%-57%
Mar 2022CfdoshfsiItem_Z26640%-66%


I am plotting this on a stacked bar chart with the Name as the y-axis, Min and Max % Diff as the x-axis, and the Month and Category in slicers. The result is somewhat of a diverging bar chart, as seen below. 

DaxPadawan_0-1671118702381.png

 

What I want to do is sort the chart by Abs Diff. I have tried sorting the Name column by the Abs Diff column, but I always get the error saying that you cannot sort by column if multiple values exist in one column for one value in the other. Any thoughts about how I could go about sorting this? 


1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@Anonymous 

If you add the ABS Dif to the tooltip on the visual you can then use it to sort the visual.  In my example I am showing paid amount by Member ID but I have added co-pay to the tooltip so I can sort the chart by co-pay amount.

jdbuchanan71_0-1671120621020.png

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@Anonymous 

If you add the ABS Dif to the tooltip on the visual you can then use it to sort the visual.  In my example I am showing paid amount by Member ID but I have added co-pay to the tooltip so I can sort the chart by co-pay amount.

jdbuchanan71_0-1671120621020.png

 

Anonymous
Not applicable

Worked like a charm, an absolute genius trick. Thank you good sir. 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors