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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

When i try column sort with 10 row of rec i also get error msg ?

Hi All

Mr Amit have try to help on below post :-

https://community.powerbi.com/t5/Desktop/GL-CODE-Sorting-get-error/m-p/1600958#M648119

I try to create a very simple PBI file to check will it come out error msg ? below is my data set :-

Paulyeo11_0-1610692934832.png

Amit have help me create below expression :-
GL_CODE_Sort =
SWITCH(
TRUE(),
PNL[GL_CODE (groups)] ="REV" ,1,
PNL[GL_CODE (groups)] ="COGS",2,
PNL[GL_CODE (groups)] ="OTHER",3,
PNL[GL_CODE (groups)] ="EXP",4,
5
)
When i try to use above filed as sort column :-
 
Paulyeo11_0-1610693217552.png

below is the error msg :-


Paulyeo11_0-1610693686803.png

 

i am using Dec 2020 version.

 
My PBI file :-
 
Hope some one can help me to test , and see will you get error msg ?
 
My expect result is Sort the GL_CODE (groups) field in following sequences :-
REV
COGS
OTHER
EXP
 
Paul
 
1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

Please see two workarounds in the attachment. hopt this is helpful.

 





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

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@Anonymous 

Please see two workarounds in the attachment. hopt this is helpful.

 





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

Proud to be a Super User!




Anonymous
Not applicable

Hi Ryan

You are very smart.

Thank

Paul

amitchandak
Super User
Super User

@Anonymous , GL_CODE_SORt is create on GL_CODE (groups) , it will not work .

 

Do this a new column GL_CODE (groups)1

GL_CODE (groups) 1 = [GL_CODE (groups)]

 

Sort this on GL_CODE_SORT  and use in viusal

Refer my video I dicussed this : https://www.youtube.com/watch?v=KK1zu4MBb-c

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amit

 

Can you pls send the PBI file , so that i can understand what you mean.

 

Paul

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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