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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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