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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
U156531
Post Patron
Post Patron

Sorting dates in a slicer

I need to be able to sort these dates by month in the slicer. There is n't any column in the Sort By Column list that works to sort these.

 

U156531_0-1727453441438.png

 

7 REPLIES 7
AnkitaaMishra
Super User
Super User

Hi @U156531 , Hope you are doing well.
I tried to replicate your problem considering that you have a date column in your table, please write below DAX to create another column : 

AnkitaaMishra_0-1727454931889.png

Now select the "Month selection" column and use "Sorting" column to sort it as shown below : 

AnkitaaMishra_1-1727455005498.png

Output : 

AnkitaaMishra_2-1727455088013.png

 

if this helps please mark it as the solution else provide additional details for your problem.

 

Thanks,

Ankita

 

 

I'm getting this syntax error trying to create the new calculated column

U156531_1-1727457208255.png

My year calcualted column is 

U156531_2-1727457257447.png

 

@U156531 please write below formula : 

Sorting =
VAR DateYear = VALUE(LEFT('Date'[Year], 4))
VAR DateMonth = MONTH(DATEVALUE('Date'[Month Number] & " 1"))
RETURN DateYear * 100 + DateMonth

Please replace the table and column name according to your table. 

You are getting an error because you are creating a VARIABLE but not returning the output.
 
 

That fixed the error in the calculated column.

I'm sorting the MTD by the new calculated column Sorting.

Unfortunately it didn't seem to sort it correctly.

U156531_1-1727460586555.png

my calendar table is below

U156531_2-1727460648015.png

 

Anonymous
Not applicable

Hi @U156531, AnkitaaMishra and Selva-Salimi, thank you for your prompt reply!

 

From your screenshot, the new column is of Text type, please change to the whole number, then sort the MTD again.

 

Best regards,

Joyce

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

U156531
Post Patron
Post Patron

Its a text field and I can't convert it to Date without getting this error below. Here is whats in the field.

U156531_0-1727454941245.png

 

Selva-Salimi
Super User
Super User

Hi @U156531 

 

Is your column in date format? I think not because if it was in Date format you can easily sort it.

 

If this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors