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
xiumi_hou
Post Partisan
Post Partisan

How to use dax function to create bar chart and show rank?

Dear all, 

 

I have below measure, the y-axis is person name, and bar is the count numbers

lala.JPG

 

Completed Cases =
CALCULATE(
DISTINCTCOUNT(d_Cases[CaseNumber])+0,
d_Cases[Closure Reason] = "Completed",
USERELATIONSHIP(d_Cases[Closed_date_c],d_date[Date]),
USERELATIONSHIP(d_Cases[Assigned_user_id],d_users[id])
)
 
How can I revise ablove dax to show thr rank of each person? 
For example, I have 5 people their score are 10,10,9,8,4
I would like to see their rank as 1,1,3,4,5
Thank you so much!
2 REPLIES 2
v-diye-msft
Community Support
Community Support

Hi @xiumi_hou 

 

You need to refer to the RANKX function, please see: https://docs.microsoft.com/en-us/dax/rankx-function-dax 

 

Try below measure:

measure = RANKX(all(table),[Completed Cases],,DESC)

 

If it doesn't meet your requirement, please share your dummy pbix that I can look into it.

 

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.
xiumi_hou
Post Partisan
Post Partisan

UP

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.