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
Palikaros
New Member

Sorting DAX measure of Current Year Actual net sales

Hello,

 

I have created the below DAX measure, where I am calculating current year net sales at Prior Year Rate for some products.

 

CY Actual Net Sales at PY = CALCULATE([CY Actual at PY], 'Report Line'[Report_Line_Parent]="Net Sales").
 
Is it possible with a DAX measure to create the top 5 of the above with descending order? Of course, values should be dynamic based on user`s selection of country and quarter, which are done through slicers.
 
I know that it is possible to do sorting within a visual, but since i want to sort the visual also per year, i would like to have already sorted the top 5 products with descending order from a DAX measure.
 
Thank you in advance.
1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

yes, you shall check the TOPN function, but it returns a table instead of a scalar value. You may aggregate based on the TOPN table. 

https://dax.guide/topn/

View solution in original post

1 REPLY 1
FreemanZ
Super User
Super User

yes, you shall check the TOPN function, but it returns a table instead of a scalar value. You may aggregate based on the TOPN table. 

https://dax.guide/topn/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.