Reply
harirao
Post Prodigy
Post Prodigy
Partially syndicated - Outbound

Need to re-arrange Bar's inside 100% Stacked Column Chart

Hello Team,

 

I have created a 100% Stacked Column Chart by using two data tables, done sort based on Descending for 0_Visibility_Graph, now i want another sort based "Delivery Priority Code" from Ascending "10, 20, 30 40 & 50", but in below snapshot you can see it is from 50 t 10.

Re-arrange.PNG

 

can you please help me on this.

 

Thank you.

 

Regards,

Hari 

6 REPLIES 6
lit2018pbi
Resolver II
Resolver II

Syndicated - Outbound

@harirao 

 

Have you tried the following?

 

Create a new table by clicking on Enter Data and fill the 2 columns

1.ID (desired sorting order)

2. Delivery Priority code

and then add the relationship between two tables by Delivery Priority Code.

Next, drag and drop the Delivery Priority code from the new table in the legend.

Now click on the visual and click on the Delivery Priority code in the new table in Fields section and then in the column tools click sort by the ID column.

 

amitchandak
Super User
Super User

Syndicated - Outbound

@harirao , Create a sort column in that order and mark that as a sort column.

refer :https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

 

Delivery Priority Code 1 = [Delivery Priority Code]

 

Delivery Priority Code Sort = Switch ( Delivery Priority Code,

"P50",1,

"P40",2,

///Add other

)

Sort Delivery Priority Code 1 on Delivery Priority Code Sort and use that

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Syndicated - Outbound

Hello @amitchandak ,

 

Thanks for your response, am getting "Argument '12' in SWITCH function is required."error while creating new column using switch function.

 

Re-arrange.PNG

Delivery Priority Code 1 = [Delivery Priority Code]
Delivery Priority Code Sort = Switch (tbl_DEP3_Big_Deal_Perf_Data[Delivery Priority Code],
"P10",1,
"P20",2,
"P30",3,
"P40",4,
"P50",5,)

Can you please help me on this.

 

Regards,

 

Syndicated - Outbound

hi @harirao 

The error is that there is another comma after 5

8.JPG

 

and I would suggest you add a conditional column in edit queries, not use calculated column by dax. calculated column usually will lead to a cyclic error when use sort by column

9.JPG

 

Regards,

Lin

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

Syndicated - Outbound

Hello @v-lili6-msft,

 

Thanks for your input, i tried with above option also still i am unable to do sort from ascending to descending.

 

Re-arrange.PNG

 

Can you please suggest any other solution.

 

Regards,

Syndicated - Outbound

hi  @harirao 

2.JPG

 

if the value should be "P10","P20","P30","P40","P50" not 10,20,30,40,50 in there?

https://radacad.com/sort-by-column-in-power-bi

 

 

if you still have the problem, please share a simple sample pbix file for us have a test.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)