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
RashmitaR
Helper IV
Helper IV

DAX query

Could someone suggest me a query to display top 10 customer names based on employee head count. 

1 ACCEPTED SOLUTION
ankitpatira
Community Champion
Community Champion

@RashmitaR If you dont' want to go down DAX way, you can use Sorty by option of visual to sort by employee head count. This will give you them in order but won't restrict it to just 10 but you can clearly make out top 10.

 

View solution in original post

3 REPLIES 3
sancha
Frequent Visitor

TOPN(10,employee,employee[employee_head_count],DESC)

Greg_Deckler
Community Champion
Community Champion

Here is a query that does that. Basically, select the drop down for the column, Sort Descending and then Keep Rows, 10.

 

let
    Source = Csv.Document(File.Contents("C:\temp\powerbi\dates.csv"),[Delimiter=",", Columns=4, Encoding=1252, QuoteStyle=QuoteStyle.None]),
    #"Promoted Headers" = Table.PromoteHeaders(Source),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date", type date}, {"Value", Int64.Type}, {"Value2", Int64.Type}, {"Value3", Int64.Type}}),
    #"Sorted Rows" = Table.Sort(#"Changed Type",{{"Value3", Order.Descending}}),
    #"Kept First Rows" = Table.FirstN(#"Sorted Rows",10)
in
    #"Kept First Rows"


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
ankitpatira
Community Champion
Community Champion

@RashmitaR If you dont' want to go down DAX way, you can use Sorty by option of visual to sort by employee head count. This will give you them in order but won't restrict it to just 10 but you can clearly make out top 10.

 

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.