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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
e175429
Helper IV
Helper IV

BI will not SORT visual correctly

Hello All!

 

I have a bar chart that shows a number of total activities for a given month and year. The chart starts with Feb 2022 and comes up to Feb 2023.

The order should be:

Feb-22

Apr-22

Jun-22

Aug-22

Oct-22

Nov22

Dec-22

Jan-23

Feb-23

e175429_0-1678980614893.png

When I sort ascending or decending, it always shows out of order.

 

I created the last 2 custom columns, MonthYear and RelativeMonth based on the Date column.

e175429_1-1678980668492.png

MonthYear  

= Date.ToText ([Date], "MMM-yy")

RelativeMonth

= 12 * Date.Year([Date]) * Date.Month([Date]) - 12 * Date.Year(DateToday) - Date.Month(DateToday)

(sn: I created a DateToday quiery)

 

MonthYear is formatted as Text. RelativeMonth is formatted as Whole Number.

 

e175429_2-1678982264758.png

I thought it would work by sorting the graph by MonthYear and then ascending or descending, but it's not working.

 

Any help will be greatly appreciated!

 

 

 

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@e175429 Try using a numeric Sort By column.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
e175429
Helper IV
Helper IV

@Greg_Deckler thank you so much! that worked. I'm upset it was that simple smh

 

e175429_0-1678983925844.png

 

Greg_Deckler
Community Champion
Community Champion

@e175429 Try using a numeric Sort By column.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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