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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
maurcoll
Helper III
Helper III

Help with adding sort to a measure

Hi

I have a simple measure

Calculate(Sum ('Table' [Sales]))

what i want to be able to do is add in something to sort by asc or desc.

I have tried adding

Calculate(
Sum 'Table' [Sales]), , asc, dense) but this is not working.
Any ideas please

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @maurcoll 

 

Based on your needs, I have created the following form.

vjialongymsft_0-1704862502493.png

 

 

You can use the following formula to get the ranking of the sales column

Sales Rank = 
RANKX(
    ALL('Table'), 
    CALCULATE(SUM('Table'[Sales])),
    , 
    DESC,
    Dense
)

 

This is the result you want

vjialongymsft_1-1704862625170.png

 

 

Best Regards,

Jayleny

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @maurcoll 

 

Based on your needs, I have created the following form.

vjialongymsft_0-1704862502493.png

 

 

You can use the following formula to get the ranking of the sales column

Sales Rank = 
RANKX(
    ALL('Table'), 
    CALCULATE(SUM('Table'[Sales])),
    , 
    DESC,
    Dense
)

 

This is the result you want

vjialongymsft_1-1704862625170.png

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

PijushRoy
Super User
Super User

Hi @maurcoll 

If you are using the above measure in any visual, in visual you have the sort option
Or you can sort by category

Can you please share the screenshot of the requirement?

If your requirement is solved, please make sure to MARK AS SOLUTION and help other users find the solution quickly. Please hit the LIKE button if this comment helps you.

Thanks
Pijush





Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





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.