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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
maheshbabu
Regular Visitor

How to sort a bar chart or clustered bar chart with two or more measures?

Hi, I am working on HR Attrition dashboard. My requirement is to build visuals which show highest attrition by supervisor in that organisation. Now, management came up with new requirement as the visual must be sorted by attrition and headcount of that supervisor. They are asking sort by highest headcount and highest attrition. How can we do sort by two measures as each supervisor has different heacounts and attriters. If any one knows, please let me know.I have applied top N filter by headcount and sorted it with attriters. But its not interactive.I have applied top N filter by headcount and sorted it with attriters. But its not interactive.

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @maheshbabu ,

 

You can first calculate the ranking of heacounts and attriters separately.

rank by heacounts = RANKX(ALL('Table'),[heacounts measure],,DESC,Dense)
rank by attriters = RANKX(ALL('Table'),[attriters measure],,DESC,Dense)

Then there will be a priority selection, here I choose ‘attriters’ to have a higher priority than 'heacounts'.

 

rank by attriters and heacounts = RANKX(ALL('Table'),[rank by attriters]*100+[rank by heacounts],,ASC,Dense)

vstephenmsft_0-1653892219765.png

 

 

Best Regards,

Stephen Tao

 

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
maheshbabu
Regular Visitor

Thanks a lot

v-stephen-msft
Community Support
Community Support

Hi @maheshbabu ,

 

You can first calculate the ranking of heacounts and attriters separately.

rank by heacounts = RANKX(ALL('Table'),[heacounts measure],,DESC,Dense)
rank by attriters = RANKX(ALL('Table'),[attriters measure],,DESC,Dense)

Then there will be a priority selection, here I choose ‘attriters’ to have a higher priority than 'heacounts'.

 

rank by attriters and heacounts = RANKX(ALL('Table'),[rank by attriters]*100+[rank by heacounts],,ASC,Dense)

vstephenmsft_0-1653892219765.png

 

 

Best Regards,

Stephen Tao

 

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

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.