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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
Fab117
Helper IV
Helper IV

Stacked Column Chart (sorted by Legend – Highest to Lower value)

Hi,

In my report, I've several Stacked Column Chart such as:

Fab117_0-1688138515338.png

 

Where "Sum Quantity" is simple measure which does the sum of the field "Quantity" from my table

 

 

Sum Quantity = SUM(ReferenceTable[Quantity])

 

 

 

My challenge is that my users are sorted by alphabetical order (from A to Z). I'd like to sort my Users by Sum Quantity. From the one with highest figure in Sum Quantity to lowest one.

I did a search with google, but the only tuto I found were to define the sorting by defining Bill as number 1, Ben as number 2, … which is not applicable for me.

As I can't attach demo file, here is a table sample:

UserQuantity
Bill6
Ben8
Mike2
Bill4
Bill5
Mike9
Ben7
Dan3
Bill5
Dan8
Mike7
Ben1
Dan2
Bill6
Dan3
Dan5
Ben8
Ben6
Mike3
Dan5
Bill7
Dan4
Ben6
Mike9
Bill8
Dan2
Dan1
Ben5
Dan6
Bill3
Bill9
Dan7
Mike2
Bill5
Dan8
Mike4
Mike6

 

Do someone would know how to solve it?

 

Fab

1 ACCEPTED SOLUTION
MohTawfik
Resolver I
Resolver I

hi @Fab117 
Solution on Right sideSolution on Right side


I did it with creating a summary table 

SummaryTable = 
SUMMARIZE(
    'Table',
    'Table'[User],
    "Total Qty", CALCULATE(SUM('Table'[Quantity]))
)

 

Create summary table then sort User with total qtyCreate summary table then sort User with total qty

 

Create relation with original tableCreate relation with original table

 

then make your stacked column visual using summary table
4.png
hope that solves your issue!

View solution in original post

3 REPLIES 3
MohTawfik
Resolver I
Resolver I

hi @Fab117 
Solution on Right sideSolution on Right side


I did it with creating a summary table 

SummaryTable = 
SUMMARIZE(
    'Table',
    'Table'[User],
    "Total Qty", CALCULATE(SUM('Table'[Quantity]))
)

 

Create summary table then sort User with total qtyCreate summary table then sort User with total qty

 

Create relation with original tableCreate relation with original table

 

then make your stacked column visual using summary table
4.png
hope that solves your issue!

Hi @MohTawfik ,

Thank you for spending time looking at my issue.

 

Have a nice week.

 

Fab

@Fab117 you welcome

same for you.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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