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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
dominik_thoe
Frequent Visitor

Sort by Key column

Hello,

I want to create a new key column and sort the table by this key. I know how to combine the fields (three columns), but how to sort the table by this new key field (with DAX)?

I know the standard sort function but I want automate it.

 

Thanks

 

Dominik

 

 

1 ACCEPTED SOLUTION
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @dominik_thoe

 

I'm afraid there is no better way to do that with dax. Below is the other way about sorting for your reference.

https://community.powerbi.com/t5/Desktop/Data-Sorted-Automatically/td-p/181603

 

Regards,

Cherie

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

View solution in original post

4 REPLIES 4
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @dominik_thoe

 

I'm afraid there is no better way to do that with dax. Below is the other way about sorting for your reference.

https://community.powerbi.com/t5/Desktop/Data-Sorted-Automatically/td-p/181603

 

Regards,

Cherie

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

I create the key in M now and use the "Sort by Column" function in the Data view. Seems to work.

Thanks

Hi @dominik_thoe

 

Glad to hear it worked, please accept the reply as solution, that way, other community members will easily find the solution when they get same issue.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ssugar
Resolver III
Resolver III

I don't think this can be done in DAX.  The normal way to do this is to use the "Sort by Column" function in the Data view.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.