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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
kenymaciel
Helper I
Helper I

Sort column when data source is SSAS

Hi, Everyone,

 

I developed a cube in SSAS.

 

When I connect through Power BI desktop, the MonthName column is not sorted.

When I connect to other data sources, I go to the DATA tab and I can sort.

 

How do I sort the MonthName column when my data source is SSAS. 

 

For exemplo: January - February- March  - April  - May................................. December

 

Thank you.

_Keny

1 ACCEPTED SOLUTION
FarhanAhmed
Community Champion
Community Champion

You need to do it at SSAS Level,

-You need to create a MonthNumber in your date dimension

- Then you need to change MonthName properties like this

Key column will be monthnumber

and Name  & Value Column will be Month Name

 

SortByCube-1.png

 

- And 2nd Property that you need to change is OrderBy to "Key"

 

SortByCube-2.png

 

Redeploy the solution and your Month Name will be sorted.

 







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
FarhanAhmed
Community Champion
Community Champion

You need to do it at SSAS Level,

-You need to create a MonthNumber in your date dimension

- Then you need to change MonthName properties like this

Key column will be monthnumber

and Name  & Value Column will be Month Name

 

SortByCube-1.png

 

- And 2nd Property that you need to change is OrderBy to "Key"

 

SortByCube-2.png

 

Redeploy the solution and your Month Name will be sorted.

 







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




Thank you @FarhanAhmed, worked perfectly ...

 

@v-easonf-msft  and @amitchandak  thanks.

 

_Keny

amitchandak
Super User
Super User

Hi,

 

I've tried it this way, it doesn't order the right way.

 

Month names are not ordered.

 

Thank you.

Hi , @kenymaciel 

There is a workaround but not applicable to all visualization.

You can create a measure and apply it to the visual, and sort according to the visual.

Ex:

 

Measure = SWITCH(SELECTEDVALUE(DimDate[EnglishMonthName]),"January",1,"February",2,"March",3,"April",4,"May",5,"June",6,"July",7,"August",8,"September",9,"October",10,"November",11,"December",12,BLANK())

 

In table,matrix..( you  need drag measure  to "values"),you can sort by this measure in visual  "more option" 

 

1.png

 

If you  want to hide the cloumn "measure" in visual, you can also directly shorten the width of the column "measure "to 0 

 

3.png

 

 

In Line Chart,Bar Chart,Pie Chart .....(you can drag measure to "tooltip" ), you can sort by this measure

2.png

 

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

 

 

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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