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
Anonymous
Not applicable

top5

Hi everyone,

i want to  filter top 5 by cost of material  and visualize it. The following DAX doesnt yield the desired result

Top5 = TOPN(5; SUMMARIZE(Sheet1; Sheet1[Material];"devcosts";  SUM[costs])

after breaking down the DAX to

tmptable =  SUMMARIZE(Sheet1; Sheet1[Material];"devcosts";  SUM[costs])

i could see that the cost column is unsorted, like so

 

image.png

how can i get a sorted cost column for the TOPN function to select from and deliver the right solution.

 

thanks in advance

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Try following

 

Top5 =
TOPN (
    5,
    SUMMARIZE ( Sheet1, Sheet1[Material], "devcosts", SUM[costs] ),
    [devcosts], DESC
)

View solution in original post

2 REPLIES 2
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

If you've fixed the issue on your own please kindly share your solution. if the above posts help, please kindly mark it as a solution to help others find it more quickly. thanks a lot!

 

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

@Anonymous 

 

Try following

 

Top5 =
TOPN (
    5,
    SUMMARIZE ( Sheet1, Sheet1[Material], "devcosts", SUM[costs] ),
    [devcosts], DESC
)

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.

Top Solution Authors