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
KoroneL
Frequent Visitor

Sort by column not possible

I have a table that I want to use to create a report. My goal is to aggregate data by the column DescLvlGroup, which is almost identical to DescCodLvl. The difference is that for aggregation, "Cash" should include (Cash + Out of Order + Other Debts + Commissions).

Row LabelsSum of value
Assets6500
Cash4650
Investiments500
Merch 13000
Merch 21000
Grand Total15650

I successfully created a measure to handle this aggregation, and it works fine. However, when I try to sort DescLvlGroup by _OrderCodLvl, Power BI gives an error because some values in _OrderCodLvl are not unique for each DescLvlGroup.

Is there any way to fix this issue? I can’t figure out how to sort it properly. Any help would be appreciated!

Here's a simplified table i used:

DescCodLvlDescCodLvlvalue_OrderCodLvlDescLvlGroup
Company 254Cash500025009999Cash
Company 263Assets650025003000Assets
Company 272.2Merch 1300025002200Merch 1
Company 282.1Merch 2100025002100Merch 2
Company 291Investiments50025001000Investiments
Company 309Out of Order025009999Cash
Company 316Other Debts-10025009999Cash
Company 325Comissions-25025009999Cash

 

Thanks in advance!

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@KoroneL Create a new calculated column in your table that concatenates DescLvlGroup and _OrderCodLvl to form a unique value for sorting.

 

UniqueSortKey = CONCATENATE(DescLvlGroup, _OrderCodLvl)

 

Use this new UniqueSortKey column to sort your DescLvlGroup column.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thanks for the reply from bhanu_gautam.

 

Hi @KoroneL ,

 

It can be sorted during my test. 

vlinhuizhmsft_0-1742202779039.png

Have you solved your problem? If it is solved, please mark the reply that help you as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster. If there are any more questions, please feel free to let us know. Thanks a lot!

 

Best Regards,
Zhu

 

bhanu_gautam
Super User
Super User

@KoroneL Create a new calculated column in your table that concatenates DescLvlGroup and _OrderCodLvl to form a unique value for sorting.

 

UniqueSortKey = CONCATENATE(DescLvlGroup, _OrderCodLvl)

 

Use this new UniqueSortKey column to sort your DescLvlGroup column.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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.