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! Learn more

Reply
sureshg2498
Advocate II
Advocate II

Sorting Department based on Total Employees (Highest to Lowest)

Hi All,

 

We have a requirement to display the department based on the total employees. Below is the sample dataset.

DepartmentFull Time EmployeesContact Employees
Sales2050
Marketing4010
Finance7030
IT15040

Current Report Structure:

sureshg2498_0-1755181586005.png

 

We would like to sort this Department based on the Total employees from Highest to lowest.

Expectation sort results from the chart would be.

 

sureshg2498_3-1755182902279.png

 

Could anyone please help me on this requirement ?

 

Thanks,

Suresh.

 

 

@Bibiano_Geraldo @rajendraongole1 @Ritaf1983 @danextian  @lbendlin @Ritaf1983 @bhanu_gautam

@MohamedFowzan1 

 

 

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi.

Create this measures

Total = Data(Data[Full time employees])+Data(Data[Contract employees])

Drag this measure to the tooltip.  Click on the 3 dots of the visual and you should now be able to sort the bars in descending order of the tooltip measure.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi.

Create this measures

Total = Data(Data[Full time employees])+Data(Data[Contract employees])

Drag this measure to the tooltip.  Click on the 3 dots of the visual and you should now be able to sort the bars in descending order of the tooltip measure.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Awesome, thank you so much Ashish! That worked perfectly.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-ssriganesh
Community Support
Community Support

Hi @sureshg2498 ,

Thank you for posting your query in the Microsoft Fabric Community Forum, and thanks to @Bmejia & @Greg_Deckler for sharing valuable insights.

 

Could you please confirm if your query has been resolved by the provided solutions? This would be helpful for other members who may encounter similar issues.

 

Thank you for being part of the Microsoft Fabric Community.

My question has been answered. Thank you so much.

Bmejia
Super User
Super User

Hi,

Create a summarize table of your main table  on  the department only with the total of both contracts and full employees.  Than hightlight the department and sort by Total.

Bmejia_0-1755187572777.png

Create a relationship between this new table and your main table

Bmejia_1-1755187641825.png

Then replace your department category with the new summarize department category and then sort visual on Department.

Bmejia_3-1755187716745.png

 



Thank you so much.

Greg_Deckler
Community Champion
Community Champion

@sureshg2498 Add a column like the following:

Sort By = [Contact Employees] + [Full Time Employees]

Set the Sort By column for Department to this column and then sort your visual by Department.



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...

Thank you for the reply, Greg.

 

I did as per your instrauctions. However, I see the below error message. Any thoughts.

Sort By = [Total Contractors]+[Total FullTime]

sureshg2498_0-1755422962017.png

 

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.

Top Solution Authors