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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.