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
RingoSun
Helper II
Helper II

Is this kind of sorting actually possible in Power BI?

RingoSun_0-1652343796530.png

I have this bar chart above and I want to change the way it is sorted. So the blue one which is the Client, I want it to always be the first one in the visual and then the rest I want them to be sorted from highest to lowest.

 

So it should look something like below.

RingoSun_1-1652343858361.png

 

Is this actually possible in Power BI? I've been playing around with the sort by columns and other stuff but I just can't get my desired result. 

 

Sample PBIX File

 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @RingoSun ,

According to your description, I download your sample data, here's my solution.

Create a calculated column in the SOS table.

Rank =
IF (
    RELATED ( 'BrandDim'[Brand] ) = "Client",
    10000,
    RANKX (
        FILTER ( 'SOS', MAX ( 'BrandDim'[Brand] ) <> "Client" ),
        SUMX (
            FILTER ( 'BrandDim', 'BrandDim'[Brand] = MAX ( 'BrandDim'[Brand] ) ),
            'SOS'[Quantity]
        ),
        ,
        ASC,
        DENSE
    )
)

Put the rank column in the visual tooltip and sort the visual axis by rank, get the result.

vkalyjmsft_0-1652860000574.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

View solution in original post

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @RingoSun ,

According to your description, I download your sample data, here's my solution.

Create a calculated column in the SOS table.

Rank =
IF (
    RELATED ( 'BrandDim'[Brand] ) = "Client",
    10000,
    RANKX (
        FILTER ( 'SOS', MAX ( 'BrandDim'[Brand] ) <> "Client" ),
        SUMX (
            FILTER ( 'BrandDim', 'BrandDim'[Brand] = MAX ( 'BrandDim'[Brand] ) ),
            'SOS'[Quantity]
        ),
        ,
        ASC,
        DENSE
    )
)

Put the rank column in the visual tooltip and sort the visual axis by rank, get the result.

vkalyjmsft_0-1652860000574.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

RingoSun
Helper II
Helper II

I've been trying out solutions to achieve this without any success so I guess it's safe to assume that this is just impossible to acheive in Power BI

Tahreem24
Super User
Super User

@RingoSun Check these videos:

https://www.youtube.com/watch?v=CpBy79AawVw

https://www.youtube.com/watch?v=uZLmWz60_do

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@Tahreem24 

 

That works for making the client to always be the first one in the visual but does not work for arranging the rest from highest to lowest 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.