cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
miguelflores
Advocate I
Advocate I

Sorting Data Manually

Hi!

 

How do I sort a stacked bar chart by age group in ascending order? 

From Below 18 Years old to 65+ Years old?

Capture.PNG

 

Thanks!

1 ACCEPTED SOLUTION

@miguelflores

I take it you've created those "Bins" with a conditional column

I'm calling this column Category in the image below

Then I use it to create another Column called Custom Sort which we'll use to sort the Bars

See image below - let me know if you have any questions...

Query Editor - Sort By Column.gif

Hope this helps! Smiley Happy

 

EDIT: I've used the Query Editor for both columns

but you can use SWITCH statements (nested IFs) to get the same results with DAX created columns! Smiley Happy

View solution in original post

6 REPLIES 6
Sean
Community Champion
Community Champion

Click the ellipses ... in the top right corner of the Visual - Sort By

I already tried it but the result looks like this:


Capture.PNG

 

In my mind it shoutd be:

Below 18 Years Old

18-24 Years Old

25-34 Years Old

35-44 Years Old

45-54 Years Old

55-64 Years Old

65+ Years Old

 

is there a way to manually sort it?

 

Thanks!

@miguelflores

I take it you've created those "Bins" with a conditional column

I'm calling this column Category in the image below

Then I use it to create another Column called Custom Sort which we'll use to sort the Bars

See image below - let me know if you have any questions...

Query Editor - Sort By Column.gif

Hope this helps! Smiley Happy

 

EDIT: I've used the Query Editor for both columns

but you can use SWITCH statements (nested IFs) to get the same results with DAX created columns! Smiley Happy

Thanks! I got it! 🙂

 

What books do you recommend in using the powerbi more effectively and efficiently? 

@miguelflores

 

You need to do something like

this:

 

 




Lima - Peru

Thanks!

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors