cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

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
Super User II
Super User II

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!!

View solution in original post

5 REPLIES 5
Super User II
Super User II

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!!

View solution in original post

Thank you @FarhanAhmed, worked perfectly ...

 

@v-easonf-msft  and @amitchandak  thanks.

 

_Keny

Super User IV
Super User IV

@kenymaciel , here you need a sort column for that.

 

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a 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
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors